Needed for proper functionality in chroot, so if it is not there, exit before doing anything. --- src/pylorax/__init__.py | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index 8eb6c7f..85a7567 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -170,6 +170,13 @@ class Lorax(BaseLoraxClass): logger.critical("no root privileges") sys.exit(1)
+ # check if /proc is mounted + logger.info("checking /proc") + if (not os.path.isdir("/proc") and not os.path.exists("/proc/mounts") + and not os.path.exists("/proc/devices")): + logger.critical("missing required /proc files (not mounted?)") + sys.exit(1) + # do we have all lorax required commands? self.lcmds = constants.LoraxRequiredCommands()
On some nfs mounts the shutil.rmtree may traceback when removing some files. This is not such a problem so we can ignore these errors and continue. --- src/pylorax/yumhelper.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/pylorax/yumhelper.py b/src/pylorax/yumhelper.py index 04ad140..904fdc2 100644 --- a/src/pylorax/yumhelper.py +++ b/src/pylorax/yumhelper.py @@ -117,7 +117,7 @@ class LoraxYumHelper(object): if os.path.islink(fname) or os.path.isfile(fname): os.unlink(fname) else: - shutil.rmtree(fname) + shutil.rmtree(fname, ignore_errors=True)
logger.debug("removed {0}".format(fname)) count += 1
anaconda-devel@lists.fedoraproject.org