]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
obysnc: use python2.5 compatible exception syntax
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 20 Apr 2011 21:33:03 +0000 (14:33 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 20 Apr 2011 21:35:09 +0000 (14:35 -0700)
Apparently using "as" in "except" blocks is a new (and not
backwards-compatible) thing in Python 2.6.x. Who knew?

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/obsync/obsync.py

index d46ec07c15f6f074145b5b98e478b8b1894725f1..2113875d3b0c487f57a01b0f1b74df0127ab44cf 100755 (executable)
@@ -45,7 +45,7 @@ class InvalidLocalName(Exception):
 def mkdir_p(path):
     try:
         os.makedirs(path)
-    except OSError as exc:
+    except OSError, exc:
         if exc.errno != errno.EEXIST:
             raise
         if (not os.path.isdir(path)):
@@ -335,7 +335,7 @@ class FileStoreIterator(object):
                 continue
             try:
                 obj_name = local_name_to_s3_name(path[len(self.base)+1:])
-            except LocalFileIsAcl as e:
+            except LocalFileIsAcl, e:
                 # ignore ACL side files when iterating
                 continue
             return Object.from_file(obj_name, path)
@@ -493,10 +493,10 @@ try:
         print "SOURCE: " + src_name
     src = Store.make_store(src_name, False,
             getenv("SRC_AKEY", "AKEY"), getenv("SRC_SKEY", "SKEY"))
-except NonexistentStore as e:
+except NonexistentStore, e:
     print >>stderr, "Fatal error: Source " + src_name + " does not exist."
     sys.exit(1)
-except Exception as e:
+except Exception, e:
     print >>stderr, "error creating source: " + str(e)
     traceback.print_exc(100000, stderr)
     sys.exit(1)
@@ -505,11 +505,11 @@ try:
         print "DESTINATION: " + dst_name
     dst = Store.make_store(dst_name, opts.create,
             getenv("DST_AKEY", "AKEY"), getenv("DST_SKEY", "SKEY"))
-except NonexistentStore as e:
+except NonexistentStore, e:
     print >>stderr, "Fatal error: Destination " + dst_name + " does " +\
         "not exist. Run with -c or --create-dest to create it automatically."
     sys.exit(1)
-except Exception as e:
+except Exception, e:
     print >>stderr, "error creating destination: " + str(e)
     traceback.print_exc(100000, stderr)
     sys.exit(1)