From: Ian Weller Date: Tue, 22 Dec 2009 01:14:04 +0000 (-0600) Subject: Metadir.create(): handle tiered repositories X-Git-Url: https://projects.mako.cc/source/mw/commitdiff_plain/7ffe2f55e5241f88a2d84d3e891288818cf53bbd?hp=a58c94092d906cad0611dda3b0fc2b18501b0299 Metadir.create(): handle tiered repositories --- diff --git a/src/mw/metadir.py b/src/mw/metadir.py index 22b9c5c..06dbeb3 100644 --- a/src/mw/metadir.py +++ b/src/mw/metadir.py @@ -46,11 +46,11 @@ class Metadir(object): def create(self, api_url): # create the directory - try: - os.mkdir(self.location, 0755) - except OSError, e: + if os.path.isdir(self.location): print '%s: you are already in a mw repo' % self.me sys.exit(1) + else: + os.mkdir(self.location, 0755) # create config self.config = ConfigParser.RawConfigParser() self.config.add_section('remote')