diff --git a/storage/devicelibs/edd.py b/storage/devicelibs/edd.py
index 1ac40a6..9563af6 100644
--- a/storage/devicelibs/edd.py
+++ b/storage/devicelibs/edd.py
@@ -104,9 +104,12 @@ class EddMatcher(object):
'chan' : self.edd.channel,
'dev' : self.edd.ata_device
}
- block_entries = os.listdir(path)
- if len(block_entries) == 1:
- name = block_entries[0]
+ if os.path.isdir(path):
+ block_entries = os.listdir(path)
+ if len(block_entries) == 1:
+ name = block_entries[0]
+ else:
+ log.warning("edd: directory does not exist: %s" % path)
elif self.edd.type == "SCSI":
pattern = "/sys/devices/pci0000:00/0000:%(pci_dev)s/virtio*/block" %
{'pci_dev' : self.edd.pci_dev}
@@ -157,7 +160,7 @@ def collect_mbrs(devices):
mbrsig = struct.unpack('I', os.read(fd, 4))
os.close(fd)
except OSError as e:
- log.warning("Error reading mbrsig from disk %s: %s" %
+ log.warning("edd: error reading mbrsig from disk %s: %s" %
(dev.name, str(e)))
continue
@@ -202,11 +205,11 @@ def get_edd_dict(devices):
name = matcher.devname_from_pci_dev()
# next try to compare mbr signatures
if name:
- log.debug("matched 0x%x to %s using pci_dev" % (edd_number, name))
+ log.debug("edd: matched 0x%x to %s using pci_dev" % (edd_number, name))
else:
name = matcher.match_via_mbrsigs(mbr_dict)
if name:
- log.info("matched 0x%x to %s using MBR sig" % (edd_number, name))
+ log.info("edd: matched 0x%x to %s using MBR sig" % (edd_number, name))
class DiskIO(object):
"""Simple object to simplify mocking of file operations in Mock
@@ -117,6 +118,12 @@ class DiskIO(object):
path = os.path.join(self._pwd, path)
return self.fs.has_key(path)
-
-
class EddTestFS(object):
def __init__(self, target_module):
self.fs = mock.DiskIO()
@@ -119,6 +126,12 @@ class EddTestFS(object):
return self.fs
+ def sda_vda_no_pcidev(self):
+ self.sda_vda()
+ entries = [e for e in self.fs.fs if e.startswith("/sys/devices/pci")]
+ map(self.fs.os_remove, entries)
+ return self.fs
+
def vda_vdb(self):
self.fs["/sys/firmware/edd/int13_dev80"] = self.fs.Dir()
self.fs["/sys/firmware/edd/int13_dev80/host_bus"] = "PCI 00:05.0 channel: 0
"
--
1.7.6
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
07-25-2011, 05:25 PM
"Brian C. Lane"
edd: do not traceback when can not find the respective pci device.
Ack to both of these.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list