From: Colin Patrick McCabe Date: Mon, 25 Apr 2011 23:39:57 +0000 (-0700) Subject: obsync: another fix for --no-preserve-acls X-Git-Tag: v0.28~139^2~34 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=87ad8da63ad0a8508840ebe49ad4e84abef34695;p=ceph.git obsync: another fix for --no-preserve-acls Signed-off-by: Colin McCabe --- diff --git a/src/obsync/obsync.py b/src/obsync/obsync.py index 43758dbe9ea43..c3c9d5dcc61df 100755 --- a/src/obsync/obsync.py +++ b/src/obsync/obsync.py @@ -261,18 +261,18 @@ s3://host/bucket/key_prefix. Failed to find the bucket.") k.get_contents_to_filename(temp_file.name) if (opts.preserve_acls): temp_acl_file = tempfile.NamedTemporaryFile(mode='w+b', - delete=False) + delete=False).name acl_xml = self.bucket.get_xml_acl(k) - temp_acl_file_f = open(temp_acl_file.name, 'w') + temp_acl_file_f = open(temp_acl_file, 'w') temp_acl_file_f.write(acl_xml) temp_acl_file_f.close() except: if (temp_file): os.unlink(temp_file.name) if (temp_acl_file): - os.unlink(temp_acl_file.name) + os.unlink(temp_acl_file) raise - return S3StoreLocalCopy(temp_file.name, temp_acl_file.name) + return S3StoreLocalCopy(temp_file.name, temp_acl_file) def all_objects(self): blrs = self.bucket.list(prefix = self.key_prefix) return S3StoreIterator(blrs.__iter__())