]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Use Python 3.x compatible octal numbers
authorDirk Mueller <dirk@dmllr.de>
Sat, 8 Jun 2013 08:59:13 +0000 (10:59 +0200)
committerDirk Mueller <dirk@dmllr.de>
Fri, 14 Jun 2013 21:39:07 +0000 (23:39 +0200)
Unfortunately, Python 3.x deprecated support for 0755
octal numbers. Use 0o755 instead.

Change-Id: I70403d382d6e6569445b6a99954ea24d436f29ad

cinder/tests/image/fake.py
cinder/tests/test_utils.py
cinder/volume/drivers/scality.py

index 814b3bd82f5ff213da93853a3f23a4fbbd3a341b..6df9ce2d85710b9db2fe9ff174521fcdc1de3b8a 100644 (file)
@@ -37,7 +37,7 @@ class _FakeImageService(object):
         self.images = {}
         # NOTE(justinsb): The OpenStack API can't upload an image?
         # So, make sure we've got one..
-        timestamp = datetime.datetime(2011, 01, 01, 01, 02, 03)
+        timestamp = datetime.datetime(2011, 1, 1, 1, 2, 3)
 
         image1 = {'id': '155d900f-4e14-4e4c-a73d-069cbf4541e6',
                   'name': 'fakeimage123456',
index 2c807ed19598ae46e29a1fd8781ca286c9985759..b7ea0729bbb622254effa0c81dc10f8456bfc94f 100644 (file)
@@ -64,7 +64,7 @@ echo $runs > "$1"
 exit 1
 ''')
             fp.close()
-            os.chmod(tmpfilename, 0755)
+            os.chmod(tmpfilename, 0o755)
             self.assertRaises(exception.ProcessExecutionError,
                               utils.execute,
                               tmpfilename, tmpfilename2, attempts=10,
@@ -109,7 +109,7 @@ echo foo > "$1"
 grep foo
 ''')
             fp.close()
-            os.chmod(tmpfilename, 0755)
+            os.chmod(tmpfilename, 0o755)
             utils.execute(tmpfilename,
                           tmpfilename2,
                           process_input='foo',
index bf16339d1b0a328b581bb2e61095fc42b165cf47..0cad54ba0c4ecf6167486274a35236de290a834d 100644 (file)
@@ -109,7 +109,7 @@ class ScalityDriver(driver.VolumeDriver):
     def _create_file(self, path, size):
         with open(path, "ab") as f:
             f.truncate(size)
-        os.chmod(path, 0666)
+        os.chmod(path, 0o666)
 
     def _copy_file(self, src_path, dest_path):
         self._execute('dd', 'if=%s' % src_path, 'of=%s' % dest_path,