[rhel7-branch] Only pass DASDs to is_ldl_dasd function. (#1248666)
by Samantha N. Bueno
This might seem obvious, but it apparently wasn't when I wrote this
code!
Resolves: rhbz#1248666
---
pyanaconda/ui/gui/spokes/storage.py | 4 ++--
pyanaconda/ui/tui/spokes/storage.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 5adbb09..25b27e6 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -682,7 +682,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
continue
if cdl:
- ldldasds = [d.name for d in getDisks(self.storage.devicetree) if is_ldl_dasd(d.name)]
+ ldldasds = [d.name for d in getDisks(self.storage.devicetree.dasd) if is_ldl_dasd(d.name)]
if not ldldasds:
# nothing to do here; bail
return
@@ -853,7 +853,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
return
# check for ldl dasds
- ldldasds = [d for d in self.selected_disks if is_ldl_dasd(d)]
+ ldldasds = [d.name for d in self.storage.devicetree.dasd if is_ldl_dasd(d.name)]
if len(ldldasds) > 0:
dialog = DasdFormatDialog(self.data, self.storage, ldldasds)
ignoreEscape(dialog.window)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
index c926a34..0895db4 100644
--- a/pyanaconda/ui/tui/spokes/storage.py
+++ b/pyanaconda/ui/tui/spokes/storage.py
@@ -276,7 +276,7 @@ class StorageSpoke(NormalTUISpoke):
if dasds:
self.run_dasdfmt(dasds)
return None
- ldldasds = [d for d in self.selected_disks if is_ldl_dasd(d)]
+ ldldasds = [d.name for d in self.storage.devicetree.dasd if is_ldl_dasd(d.name)]
if ldldasds:
self.run_dasdfmt(ldldasds)
return None
--
1.9.3
8 years, 9 months
[blivet][master/rhel7-branch] Fix some logical problems in write_dasd_conf (#1248949)
by Samantha N. Bueno
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
8 years, 9 months