diff options
author | David Cantrell <dcantrell@redhat.com> | 2010-05-03 18:33:29 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2010-05-04 06:09:00 -1000 |
commit | d69e040ff4e252cc618901625ad2d991cb9fb788 (patch) | |
tree | 70316c628577cf46d93bc4cf315ed059423fbffe /storage | |
parent | 20f478d5ff0a78955eed191c17190676b2a21840 (diff) | |
download | anaconda-d69e040ff4e252cc618901625ad2d991cb9fb788.tar.gz anaconda-d69e040ff4e252cc618901625ad2d991cb9fb788.tar.xz anaconda-d69e040ff4e252cc618901625ad2d991cb9fb788.zip |
Fix some minor problems in storage/dasd.py (#560702)
Still some remaining issues with this bug. Issues fixed:
1) Correct calls to deviceNameToDiskByPath() to account for udev
changes there.
2) Modify self._dasdlist to store both the dasd name and the by-path
link name.
3) Make sure the UI elements display full device paths.
4) Do not pop the progress window until all formatting is complete.
Tested on latest s390x nightly in text and gui mode.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/dasd.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/storage/dasd.py b/storage/dasd.py index d8766d92d..f942d5d87 100644 --- a/storage/dasd.py +++ b/storage/dasd.py @@ -101,11 +101,11 @@ class DASD: f.close() if status in ["unformatted"] and device not in exclusiveDisks: - bypath = deviceNameToDiskByPath("/dev/" + device) + bypath = deviceNameToDiskByPath(device) log.info(" %s (%s) status is %s, needs dasdfmt" % (device, bypath, status,)) - self._dasdlist.append(device) + self._dasdlist.append((device, bypath)) if not len(self._dasdlist): log.info(" no unformatted DASD devices found") @@ -120,14 +120,12 @@ class DASD: "command, unable to run dasdfmt, exiting installer") sys.exit(0) - tmplist = map(lambda s: "/dev/" + s, self._dasdlist) - self._dasdlist = map(lambda s: deviceNameToDiskByPath(s), tmplist) c = len(self._dasdlist) if intf and askUser: devs = '' - for dasd in self._dasdlist: - devs += "%s\n" % (dasd,) + for dasd, bypath in self._dasdlist: + devs += "/dev/disk/by-path/%s\n" % (bypath,) rc = intf.questionInitializeDASD(c, devs) if rc == 1: @@ -140,8 +138,8 @@ class DASD: # gather total cylinder count argv = ["-t", "-v"] + self.commonArgv - for dasd in self._dasdlist: - buf = iutil.execWithCapture(self.dasdfmt, argv + [dasd], + for dasd, bypath in self._dasdlist: + buf = iutil.execWithCapture(self.dasdfmt, argv + ["/dev/" + dasd], stderr=err) for line in buf.splitlines(): if line.startswith("Drive Geometry: "): @@ -165,10 +163,9 @@ class DASD: else: pw = intf.progressWindow(title, msg, 100, pulse=True) - for dasd in self._dasdlist: - bypath = deviceNameToDiskByPath("/dev/" + dasd) - log.info("Running dasdfmt on %s" % (bypath,)) - arglist = argv + [dasd] + for dasd, bypath in self._dasdlist: + log.info("Running dasdfmt on /dev/disk/by-path/%s" % (bypath,)) + arglist = argv + ["/dev/" + dasd] try: if intf and self.totalCylinders: @@ -190,8 +187,8 @@ class DASD: if rc: raise DasdFormatError("dasdfmt failed: %s" % rc, bypath) - if intf: - pw.pop() + if intf: + pw.pop() def addDASD(self, dasd): """ Adds a DASDDevice to the internal list of DASDs. """ |