]> projects.mako.cc - mw/commitdiff
Metadir.create(): handle tiered repositories
authorIan Weller <ian@ianweller.org>
Tue, 22 Dec 2009 01:14:04 +0000 (19:14 -0600)
committerIan Weller <ian@ianweller.org>
Tue, 22 Dec 2009 01:14:04 +0000 (19:14 -0600)
src/mw/metadir.py

index 22b9c5cf0049144092ecc6c0b2d1aee4e7365020..06dbeb368b5046d672c682a984988e2406260274 100644 (file)
@@ -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')

Benjamin Mako Hill || Want to submit a patch?