Skip to content

Commit

Permalink
Refactor dm_devices dictionary construction
Browse files Browse the repository at this point in the history
  • Loading branch information
bgurney-rh committed Nov 17, 2023
1 parent fd18c6a commit 1a7d93a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions testlib/infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,13 @@ class SysfsMonitor(unittest.TestCase):

def tearDown(self):
if SysfsMonitor.verify_sysfs: # pylint: disable=no-member
dm_devices = {}
for dmdev in os.listdir("/dev/mapper"):
dmdev_path = os.path.join("/dev/mapper", dmdev)
dmdev_num = os.path.basename(os.path.realpath(dmdev_path))
dm_devices[dmdev_num] = dmdev
dev_mapper = "/dev/mapper"
dm_devices = {
os.path.basename(
os.path.realpath(os.path.join(dev_mapper, dmdev))
): dmdev
for dmdev in os.listdir(dev_mapper)
}

try:
misaligned_devices = []
Expand Down

0 comments on commit 1a7d93a

Please sign in to comment.