From: Mike Frysinger <vapier@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: [gentoo-catalyst] [PATCH 1/9] convert octals to py3 compat
Date: Mon, 12 Oct 2015 00:35:54 -0400 [thread overview]
Message-ID: <1444624562-26162-1-git-send-email-vapier@gentoo.org> (raw)
---
catalyst/base/clearbase.py | 4 ++--
catalyst/base/resume.py | 4 ++--
catalyst/base/stagebase.py | 14 +++++++-------
catalyst/fileops.py | 2 +-
catalyst/targets/netboot2.py | 2 +-
catalyst/targets/snapshot.py | 2 +-
6 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/catalyst/base/clearbase.py b/catalyst/base/clearbase.py
index 3817196..9a4c625 100644
--- a/catalyst/base/clearbase.py
+++ b/catalyst/base/clearbase.py
@@ -30,13 +30,13 @@ class ClearBase(object):
def clear_chroot(self):
self.chroot_lock.unlock()
log.notice('Clearing the chroot path ...')
- clear_dir(self.settings["chroot_path"], 0755, True)
+ clear_dir(self.settings["chroot_path"], 0o755, True)
def remove_chroot(self):
self.chroot_lock.unlock()
log.notice('Removing the chroot path ...')
- clear_dir(self.settings["chroot_path"], 0755, True, remove=True)
+ clear_dir(self.settings["chroot_path"], 0o755, True, remove=True)
def clear_packages(self, remove=False):
diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py
index 99d8abc..70d9a4f 100644
--- a/catalyst/base/resume.py
+++ b/catalyst/base/resume.py
@@ -25,7 +25,7 @@ class AutoResume(object):
'''
- def __init__(self, basedir, mode=0755):
+ def __init__(self, basedir, mode=0o755):
self.basedir = basedir
ensure_dirs(basedir, mode=mode, fatal=True)
self._points = {}
@@ -131,7 +131,7 @@ class AutoResume(object):
@remove: boolean, passed through to clear_dir()
@return boolean
'''
- if clear_dir(self.basedir, mode=0755, chg_flags=True, remove=remove):
+ if clear_dir(self.basedir, mode=0o755, chg_flags=True, remove=remove):
self._points = {}
return True
return False
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 740e05d..a4832ec 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -492,7 +492,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
))
if "autoresume" in self.settings["options"]:
log.info('The autoresume path is %s', self.settings['autoresume_path'])
- self.resume = AutoResume(self.settings["autoresume_path"], mode=0755)
+ self.resume = AutoResume(self.settings["autoresume_path"], mode=0o755)
def set_controller_file(self):
self.settings["controller_file"]=normpath(self.settings["sharedir"]+\
@@ -773,10 +773,10 @@ class StageBase(TargetBase, ClearBase, GenBase):
ensure_dirs(self.settings["chroot_path"]+"/tmp",mode=1777)
if "pkgcache" in self.settings["options"]:
- ensure_dirs(self.settings["pkgcache_path"],mode=0755)
+ ensure_dirs(self.settings["pkgcache_path"],mode=0o755)
if "kerncache" in self.settings["options"]:
- ensure_dirs(self.settings["kerncache_path"],mode=0755)
+ ensure_dirs(self.settings["kerncache_path"],mode=0o755)
log.notice('%s', display_msg % unpack_info)
@@ -848,7 +848,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
cleanup_cmd = "rm -rf " + target_portdir
log.info('unpack() cleanup_cmd = %s', cleanup_cmd)
cmd(cleanup_cmd,cleanup_errmsg,env=self.env)
- ensure_dirs(target_portdir, mode=0755)
+ ensure_dirs(target_portdir, mode=0o755)
log.notice('Unpacking portage tree (this can take a long time) ...')
if not self.decompressor.extract(unpack_info):
@@ -936,11 +936,11 @@ class StageBase(TargetBase, ClearBase, GenBase):
_cmd = ''
log.debug('bind(); x = %s', x)
target = normpath(self.settings["chroot_path"] + self.target_mounts[x])
- ensure_dirs(target, mode=0755)
+ ensure_dirs(target, mode=0o755)
if not os.path.exists(self.mountmap[x]):
if self.mountmap[x] not in ["tmpfs", "shmfs"]:
- ensure_dirs(self.mountmap[x], mode=0755)
+ ensure_dirs(self.mountmap[x], mode=0o755)
src=self.mountmap[x]
log.debug('bind(); src = %s', src)
@@ -1222,7 +1222,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
# the proper perms and ownership
mystat=os.stat(myemp)
shutil.rmtree(myemp)
- ensure_dirs(myemp, mode=0755)
+ ensure_dirs(myemp, mode=0o755)
os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
os.chmod(myemp,mystat[ST_MODE])
self.resume.enable("empty")
diff --git a/catalyst/fileops.py b/catalyst/fileops.py
index 8fb2a36..1ef6b4c 100644
--- a/catalyst/fileops.py
+++ b/catalyst/fileops.py
@@ -37,7 +37,7 @@ def ensure_dirs(path, gid=-1, uid=-1, mode=0o755, minimal=True,
:param mode: permissions to set any created directories to
:param minimal: boolean controlling whether or not the specified mode
must be enforced, or is the minimal permissions necessary. For example,
- if mode=0755, minimal=True, and a directory exists with mode 0707,
+ if mode=0o755, minimal=True, and a directory exists with mode 0707,
this will restore the missing group perms resulting in 757.
:param failback: function to run in the event of a failed attemp
to create the directory.
diff --git a/catalyst/targets/netboot2.py b/catalyst/targets/netboot2.py
index d882a06..8644786 100644
--- a/catalyst/targets/netboot2.py
+++ b/catalyst/targets/netboot2.py
@@ -157,7 +157,7 @@ class netboot2(StageBase):
# the proper perms and ownership
mystat=os.stat(myemp)
shutil.rmtree(myemp)
- ensure_dirs(myemp, mode=0755)
+ ensure_dirs(myemp, mode=0o755)
os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
os.chmod(myemp,mystat[ST_MODE])
self.resume.enable("empty")
diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py
index d19f4ef..dbc4b1c 100644
--- a/catalyst/targets/snapshot.py
+++ b/catalyst/targets/snapshot.py
@@ -106,6 +106,6 @@ class snapshot(TargetBase, GenBase):
if os.uname()[0] == "FreeBSD":
os.system("chflags -R noschg "+myemp)
shutil.rmtree(myemp)
- ensure_dirs(myemp, mode=0755)
+ ensure_dirs(myemp, mode=0o755)
os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
os.chmod(myemp,mystat[ST_MODE])
--
2.5.2
next reply other threads:[~2015-10-12 4:36 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-12 4:35 Mike Frysinger [this message]
2015-10-12 4:35 ` [gentoo-catalyst] [PATCH 2/9] make_target_table: rewrite for py3/stability Mike Frysinger
2015-10-28 14:46 ` Brian Dolbec
2015-10-28 16:49 ` Mike Frysinger
2015-10-28 17:15 ` Brian Dolbec
2015-10-12 4:35 ` [gentoo-catalyst] [PATCH 3/9] stagebase: disable undefined-variable lint warning Mike Frysinger
2015-10-12 4:35 ` [gentoo-catalyst] [PATCH 4/9] log: make sure NOTICE is an int Mike Frysinger
2015-10-12 4:35 ` [gentoo-catalyst] [PATCH 5/9] genbase: use sorted() with dict keys Mike Frysinger
2015-10-12 4:35 ` [gentoo-catalyst] [PATCH 6/9] hash_utils: fix bad keyword w/CatalystError Mike Frysinger
2015-10-12 4:36 ` [gentoo-catalyst] [PATCH 7/9] hash_utils: decode output of popen Mike Frysinger
2015-10-28 14:49 ` Brian Dolbec
2015-10-12 4:36 ` [gentoo-catalyst] [PATCH 8/9] lint: convert type/types to isinstance Mike Frysinger
2015-10-28 14:55 ` Brian Dolbec
2015-10-12 4:36 ` [gentoo-catalyst] [PATCH 9/9] lint: fix redefined-outer-name warnings Mike Frysinger
2015-10-28 14:58 ` Brian Dolbec
2015-10-12 4:41 ` [gentoo-catalyst] [PATCH 1/9] convert octals to py3 compat Mike Frysinger
2015-10-22 5:17 ` Mike Frysinger
2015-10-24 7:00 ` Mike Frysinger
2015-10-28 14:25 ` Brian Dolbec
2015-10-24 11:37 ` Anthony G. Basile
2015-10-24 14:16 ` Anthony G. Basile
2015-11-09 4:52 ` Brian Dolbec
2015-11-19 4:19 ` Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444624562-26162-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gentoo-catalyst@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox