Use python3 compatible octal notation

This commit is contained in:
Cole Robinson 2017-05-05 13:05:30 -04:00
parent 62feeb02a8
commit 34c193108c
6 changed files with 8 additions and 7 deletions

View File

@ -367,7 +367,7 @@ class vmmConnection(vmmGObject):
uri = self.get_uri().replace("/", "_")
ret = os.path.join(util.get_cache_dir(), uri)
if not os.path.exists(ret):
os.makedirs(ret, 0755)
os.makedirs(ret, 0o755)
return ret
def get_default_storage_format(self):

View File

@ -1823,7 +1823,7 @@ class vmmDomain(vmmLibvirtObject):
def get_cache_dir(self):
ret = os.path.join(self.conn.get_cache_dir(), self.get_uuid())
if not os.path.exists(ret):
os.makedirs(ret, 0755)
os.makedirs(ret, 0o755)
return ret

View File

@ -195,7 +195,7 @@ def setupLogging(appname, debug_stdout, do_quiet, cli_app=True):
raise RuntimeError("No write access to directory %s" % vi_dir)
try:
os.makedirs(vi_dir, 0751)
os.makedirs(vi_dir, 0o751)
except IOError as e:
raise RuntimeError("Could not create directory %s: %s" %
(vi_dir, e))

View File

@ -435,7 +435,8 @@ class CloneStorageCreator(_StorageCreator):
sparse = True
fd = None
try:
fd = os.open(self._output_path, os.O_WRONLY | os.O_CREAT, 0640)
fd = os.open(self._output_path, os.O_WRONLY | os.O_CREAT,
0o640)
os.ftruncate(fd, size_bytes)
finally:
if fd:
@ -455,7 +456,7 @@ class CloneStorageCreator(_StorageCreator):
try:
src_fd = os.open(self._input_path, os.O_RDONLY)
dst_fd = os.open(self._output_path,
os.O_WRONLY | os.O_CREAT, 0640)
os.O_WRONLY | os.O_CREAT, 0o640)
i = 0
while 1:

View File

@ -90,7 +90,7 @@ def perform_initrd_injections(initrd, injections, scratchdir):
return
tempdir = tempfile.mkdtemp(dir=scratchdir)
os.chmod(tempdir, 0775)
os.chmod(tempdir, 0o775)
for filename in injections:
logging.debug("Copying %s to the initrd.", filename)

View File

@ -254,7 +254,7 @@ def make_scratchdir(conn, hvtype):
not os.access(scratch, os.W_OK)):
scratch = os.path.join(get_cache_dir(), "boot")
if not os.path.exists(scratch):
os.makedirs(scratch, 0751)
os.makedirs(scratch, 0o751)
return scratch