[blivet][master/rhel7-branch] Fix some logical problems in write_dasd_conf (#1248949)

Samantha N. Bueno sbueno+anaconda at redhat.com
Tue Aug 4 21:21:41 UTC 2015


First, don't continue to attempt writing /etc/dasd.conf if users are
not on s390x _and_ there were no dasds used during installation. Not
'or'.

Second, self.dasd in blivet is empty for some reason(?), but
devicetree.dasd contains the list of DASDs used during installation,
so pass this in to write_dasd_conf.

Resolves: rhbz#1248949
---
 blivet/__init__.py        | 2 +-
 blivet/devicelibs/dasd.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index cba90cd..f202693 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -1604,7 +1604,7 @@ class Blivet(object):
         self.iscsi.write(_sysroot, self)
         self.fcoe.write(_sysroot)
         self.zfcp.write(_sysroot, self.devicetree.getDevicesByType("zfcp"))
-        write_dasd_conf(self.dasd, _sysroot)
+        write_dasd_conf(self.devicetree.dasd, _sysroot)
 
     def turnOnSwap(self):
         self.fsset.turnOnSwap(rootPath=_sysroot)
diff --git a/blivet/devicelibs/dasd.py b/blivet/devicelibs/dasd.py
index eb4da80..f75576a 100644
--- a/blivet/devicelibs/dasd.py
+++ b/blivet/devicelibs/dasd.py
@@ -285,7 +285,7 @@ def write_dasd_conf(disks, root):
     """ Write /etc/dasd.conf to target system for all DASD devices
         configured during installation.
     """
-    if not (arch.isS390() or disks):
+    if not (arch.isS390() and disks):
         return
 
     with open(os.path.realpath(root + "/etc/dasd.conf"), "w") as f:
-- 
1.9.3



More information about the anaconda-patches mailing list