Skip to content

Commit

Permalink
test: debug why tests_lvm_pool_members_nvme_generated fails
Browse files Browse the repository at this point in the history
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
  • Loading branch information
richm committed Jan 29, 2025
1 parent d004331 commit 243dd8e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions library/find_unused_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,17 @@ def run_module():
sector_sizes[ss].append(path)
else:
sector_sizes[ss] = [path]
disks = [os.path.basename(p) for p in max(sector_sizes.values(), key=len)]
try:
disks = [os.path.basename(p) for p in max(sector_sizes.values(), key=len)]
except ValueError as ve:
result["info"] = info
module.fail_json(msg=str(ve), **result)

Check warning on line 252 in library/find_unused_disk.py

View check run for this annotation

Codecov / codecov/patch

library/find_unused_disk.py#L248-L252

Added lines #L248 - L252 were not covered by tests
else:
disks = [os.path.basename(p) for p in disks.keys()]
try:
disks = [os.path.basename(p) for p in disks.keys()]
except ValueError as ve:
result["info"] = info
module.fail_json(msg=str(ve), **result)

Check warning on line 258 in library/find_unused_disk.py

View check run for this annotation

Codecov / codecov/patch

library/find_unused_disk.py#L254-L258

Added lines #L254 - L258 were not covered by tests

if not disks:
result['disks'] = "Unable to find unused disk"
Expand Down

0 comments on commit 243dd8e

Please sign in to comment.