Commit 95170ca4 authored by Felix Seibert's avatar Felix Seibert
Browse files

printing all OSDs of files when verifying a folder

parent b204673b
......@@ -64,9 +64,10 @@ def print_tree(path):
print(file_name)
xtfsutil = subprocess.run(["xtfsutil", file_name],
stdout=subprocess.PIPE, universal_newlines=True)
osd_of_file = extract_osd(xtfsutil.stdout)
osd_set.add(osd_of_file)
print(osd_of_file)
osds_of_file = extract_osd(xtfsutil.stdout)
for osd_of_file in osds_of_file:
osd_set.add(osd_of_file)
print(osds_of_file)
print("number of files: " + str(number_of_files))
print("OSDs: " + str(osd_set))
......@@ -74,9 +75,11 @@ def print_tree(path):
def extract_osd(xtfsutil_string):
string_elements = xtfsutil_string.split('\n')
osd_list = []
for splitString in string_elements:
if splitString.lstrip().startswith("OSD 1"):
if splitString.lstrip().startswith("OSD "):
end_index = splitString.rfind(" ")
begin_index = splitString.rfind(" ", 0, end_index) + 1
uuid_substring = splitString[begin_index:end_index]
return uuid_substring
osd_list.append(uuid_substring)
return osd_list
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment