netgod / rpms / anaconda

Forked from rpms/anaconda 2 years ago
Clone
Blob Blame History Raw
From 7c4f34a595372b752c8140d25bf503af1222153c Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Tue, 11 Mar 2014 14:34:12 -0700
Subject: [PATCH 03/20] Use ROOT_PATH not /mnt/sysimage

Cleanup a couple places that were using /mnt/sysimage instead of
ROOT_PATH from constants.

Resolves: rhbz#1113535
Port of rpmostreepayload patches from master
commit 1ea3a19565d92d3a1077a7beeb2f369c76ed8b8d
---
 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.9.3