[master 8/12] edd: Log every glob.glob() match in our test data log.
vathpela
installerbot-noreply at redhat.com
Thu Oct 29 17:45:14 UTC 2015
From: Peter Jones <pjones at redhat.com>
This way we can be sure we collect them for test cases.
Signed-off-by: Peter Jones <pjones at redhat.com>
---
blivet/devicelibs/edd.py | 13 -------------
blivet/util.py | 8 +++++++-
2 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/blivet/devicelibs/edd.py b/blivet/devicelibs/edd.py
index 69e42fb..e0cf24d 100644
--- a/blivet/devicelibs/edd.py
+++ b/blivet/devicelibs/edd.py
@@ -354,9 +354,7 @@ def __init__(self, edd_entry, root=None):
def devname_from_ata_pci_dev(self):
pattern = util.Path('/sys/block/*', root=self.root)
- testdata_log.debug("sysfs glob: %s", pattern)
for path in pattern.glob():
- testdata_log.debug("sysfs glob match: %s", path)
emptyslash = util.Path("/", root=self.root)
path = util.Path(path, root=self.root)
link = util.sysfs_readlink(path=emptyslash, link=path)
@@ -422,9 +420,7 @@ def devname_from_ata_pci_dev(self):
dev = util.join_paths(fn + ['dev%d.*' % (ata_port_idx,)])
dev = util.Path(dev, root=self.root)
for ataglob in [pmp, dev]:
- testdata_log.debug("sysfs glob: %s", ataglob)
for atapath in ataglob.glob():
- testdata_log.debug("sysfs glob match: %s", atapath)
match = expmatcher.match(atapath.ondisk)
if match is None:
continue
@@ -465,10 +461,7 @@ def devname_from_scsi_pci_dev(self):
}
path = util.Path(tmpl0 % args, root=self.root)
pattern = util.Path(tmpl1 % args, root=self.root)
- testdata_log.debug("sysfs glob: %s", pattern)
matching_paths = list(pattern.glob())
- for mp in matching_paths:
- testdata_log.debug("sysfs glob match: %s", mp)
if os.path.isdir(path.ondisk):
block_entries = os.listdir(path.ondisk)
if len(block_entries) == 1:
@@ -501,11 +494,7 @@ def devname_from_scsi_pci_dev(self):
def devname_from_virt_pci_dev(self):
pattern = util.Path("/sys/devices/pci0000:00/0000:%s/virtio*" %
(self.edd.pci_dev,), root=self.root)
- testdata_log.debug("sysfs glob: %s", pattern)
matching_paths = tuple(pattern.glob())
- for mp in matching_paths:
- testdata_log.debug("sysfs glob match: %s", mp)
-
if len(matching_paths) == 1 and os.path.exists(matching_paths[0]):
# Normal VirtIO devices just have the block link right there...
newpath = util.Path(matching_paths[0], root=self.root) + "/block"
@@ -567,9 +556,7 @@ def match_via_mbrsigs(self, mbr_dict):
def collect_edd_data(root=None):
edd_data_dict = {}
globstr = util.Path("/sys/firmware/edd/int13_dev*/", root=root)
- testdata_log.debug("sysfs glob: %s", globstr)
for path in globstr.glob():
- testdata_log.debug("sysfs glob match: %s", path)
match = re_bios_device_number.match(path)
biosdev = int("0x%s" % (match.group(1),), base=16)
log.debug("edd: found device 0x%x at %s", biosdev, path)
diff --git a/blivet/util.py b/blivet/util.py
index c67ddba..2d4ad81 100644
--- a/blivet/util.py
+++ b/blivet/util.py
@@ -135,8 +135,14 @@ def glob(self):
account when globbing and returns path objects with the same
root, so you don't have to think about that part.
"""
+
+ testdata_log.debug("glob: %s", self.ondisk)
+ if "None" in self.ondisk:
+ log.error("glob: %s", self.ondisk)
+ log.error("^^ Somehow \"None\" got logged and that's never right.")
for g in glob.glob(self.ondisk):
- yield Path(g, root=self.root)
+ testdata_log.debug("glob match: %s", g)
+ yield Path(g, self.root)
def __hash__(self):
return self._path.__hash__()
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/e543c21f01a4912e503098da19c635a9e0947b8d
More information about the anaconda-patches
mailing list