Right now, it's being set before enable_installer_mode is called which means
ROOT_PATH is still set to / when iscsi.write is called, which causes the
contents of the installation media to be deleted.
Related: rhbz#962865
---
blivet/__init__.py | 13 ++++++++-----
blivet/dasd.py | 3 +--
blivet/fcoe.py | 3 +--
blivet/iscsi.py | 3 +--
blivet/zfcp.py | 3 +--
5 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py
index 08f3a05..45614d6 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -24,7 +24,10 @@ __version__ = '0.13'
##
## Default stub values for installer-specific stuff that gets set up in
-## enable_installer_mode.
+## enable_installer_mode. These constants are only for use inside this file.
+## For use in other blivet files, they must either be passed to the function
+## in question or care must be taken so they are imported only after
+## enable_installer_mode is called.
##
isys = None
ROOT_PATH = '/'
@@ -1619,10 +1622,10 @@ class Blivet(object):
self.fsset.write()
self.makeMtab()
- self.iscsi.write(self)
- self.fcoe.write()
- self.zfcp.write()
- self.dasd.write()
+ self.iscsi.write(ROOT_PATH, self)
+ self.fcoe.write(ROOT_PATH)
+ self.zfcp.write(ROOT_PATH)
+ self.dasd.write(ROOT_PATH)
def turnOnSwap(self, upgrading=None):
self.fsset.turnOnSwap(rootPath=ROOT_PATH,
diff --git a/blivet/dasd.py b/blivet/dasd.py
index 8370e9b..46a23d5 100644
--- a/blivet/dasd.py
+++ b/blivet/dasd.py
@@ -25,7 +25,6 @@ from .errors import DasdFormatError
from .devices import deviceNameToDiskByPath
from . import util
from . import arch
-from . import ROOT_PATH
from .udev import udev_trigger
import logging
@@ -187,7 +186,7 @@ class DASD:
""" Clear the device list to force re-populate on next access.
"""
self._devices = []
- def write(self):
+ def write(self, ROOT_PATH):
""" Write /etc/dasd.conf to target system for all DASD devices
configured during installation.
"""
diff --git a/blivet/fcoe.py b/blivet/fcoe.py
index 188b41b..4bbd8c3 100644
--- a/blivet/fcoe.py
+++ b/blivet/fcoe.py
@@ -21,7 +21,6 @@ import os
from . import util
from .udev import udev_settle
#from pyanaconda import isys
-from . import ROOT_PATH
import logging
import time
log = logging.getLogger("blivet")
@@ -134,7 +133,7 @@ class fcoe(object):
self._stabilize()
self.nics.append((nic, dcb, auto_vlan))
- def write(self):
+ def write(self, ROOT_PATH):
if not self.nics:
return
diff --git a/blivet/iscsi.py b/blivet/iscsi.py
index 654de63..d35dbea 100644
--- a/blivet/iscsi.py
+++ b/blivet/iscsi.py
@@ -18,7 +18,6 @@
# along with this program. If not, see <
http://www.gnu.org/licenses/>.
#
-from . import ROOT_PATH
from udev import udev_settle
from . import util
from .flags import flags
@@ -377,7 +376,7 @@ class iscsi(object):
self.stabilize()
- def write(self, storage):
+ def write(self, ROOT_PATH, storage):
if not self.initiatorSet:
return
diff --git a/blivet/zfcp.py b/blivet/zfcp.py
index f635a1a..cf8ec40 100644
--- a/blivet/zfcp.py
+++ b/blivet/zfcp.py
@@ -21,7 +21,6 @@
import string
import os
-from . import ROOT_PATH
from udev import udev_settle
from . import util
@@ -410,7 +409,7 @@ class ZFCP:
except ValueError as e:
log.warn(str(e))
- def write(self):
+ def write(self, ROOT_PATH):
if len(self.fcpdevs) == 0:
return
f = open(ROOT_PATH + zfcpconf, "w")
--
1.8.1.2