[PATCH 2/2] Use ROOT_PATH not /mnt/sysimage

Brian C. Lane bcl at redhat.com
Tue Mar 11 23:02:03 UTC 2014


Cleanup a couple places that were using /mnt/sysimage instead of
ROOT_PATH from constants.
---
 pyanaconda/exception.py | 8 ++++----
 pyanaconda/users.py     | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index ed434a7..861425f 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -158,13 +158,13 @@ class AnacondaExceptionHandler(ExceptionHandler):
     def postWriteHook(self, dump_info):
         anaconda = dump_info.object
 
-        # See if /mnt/sysimage is present and put exception there as well
-        if os.access("/mnt/sysimage/root", os.X_OK):
+        # See if there is a /root present in the root path and put exception there as well
+        if os.access(ROOT_PATH + "/root", os.X_OK):
             try:
-                dest = "/mnt/sysimage/root/%s" % os.path.basename(self.exnFile)
+                dest = ROOT_PATH + "/root/%s" % os.path.basename(self.exnFile)
                 shutil.copyfile(self.exnFile, dest)
             except:
-                log.error("Failed to copy %s to /mnt/sysimage/root" % self.exnFile)
+                log.error("Failed to copy %s to %s/root" % (self.exnFile, ROOT_PATH))
                 pass
 
         # run kickstart traceback scripts (if necessary)
diff --git a/pyanaconda/users.py b/pyanaconda/users.py
index d43ad29..9e09be0 100644
--- a/pyanaconda/users.py
+++ b/pyanaconda/users.py
@@ -192,7 +192,7 @@ class Users:
         """
 
         childpid = os.fork()
-        root = kwargs.get("root", "/mnt/sysimage")
+        root = kwargs.get("root", ROOT_PATH)
 
         if not childpid:
             if not root in ["","/"]:
@@ -258,7 +258,7 @@ class Users:
                         available one is used.
         """
         childpid = os.fork()
-        root = kwargs.get("root", "/mnt/sysimage")
+        root = kwargs.get("root", ROOT_PATH)
 
         if not childpid:
             if not root in ["","/"]:
@@ -358,7 +358,7 @@ class Users:
         else:
             return False
 
-    def checkUserExists(self, username, root="/mnt/sysimage"):
+    def checkUserExists(self, username, root=ROOT_PATH):
         childpid = os.fork()
 
         if not childpid:
-- 
1.8.5.3



More information about the anaconda-patches mailing list