Skip to content

Commit

Permalink
Merge pull request #277 from mulkieran/also_pool_uuid
Browse files Browse the repository at this point in the history
StratisDbus.pool_list returns UUID
  • Loading branch information
mulkieran authored Aug 9, 2024
2 parents d81e05f + bac92de commit 6b97c5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions testlib/dbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def stopped_pools():
def pool_list():
"""
Query the pools
:return: A list of object paths and names
:rtype: List of str * str
:return: A list of object paths, names, and UUIDs
:rtype: List of str * str * str
"""
pool_objects = [
(obj_path, obj_data[StratisDbus._POOL_IFACE])
Expand All @@ -184,7 +184,10 @@ def pool_list():
and obj_data[StratisDbus._POOL_IFACE]["Name"].startswith(_TEST_PREF)
]

return [(obj_path, pool_obj["Name"]) for obj_path, pool_obj in pool_objects]
return [
(obj_path, pool_obj["Name"], pool_obj["Uuid"])
for obj_path, pool_obj in pool_objects
]

@staticmethod
def blockdev_list():
Expand Down
4 changes: 2 additions & 2 deletions testlib/infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def check_result(result, format_str, format_str_args):
)

# Remove Pools
for _, name in StratisDbus.pool_list():
for _, name, _ in StratisDbus.pool_list():
check_result(StratisDbus.pool_destroy(name), "failed to destroy pool %s", name)

# Unset all Stratis keys
Expand Down Expand Up @@ -312,7 +312,7 @@ def run_check(self, stop_time):
# Wait for D-Bus to settle, so D-Bus and metadata can be compared
time.sleep(sleep_time(stop_time, 16))

for object_path, _ in StratisDbus.pool_list():
for object_path, _, _ in StratisDbus.pool_list():
(current, current_return_code, current_message) = (
StratisDbus.pool_get_metadata(object_path)
)
Expand Down

0 comments on commit 6b97c5b

Please sign in to comment.