Commit 56cf83aa authored by Felix Seibert's avatar Felix Seibert
Browse files

fix doc, make prints conditional on debug boolen parameter

parent e317dbc0
......@@ -45,7 +45,7 @@ class DataDistribution(object):
def get_osd_list(self):
"""
get a list of all existing OSDs.
get a list of all existing OSD uuids.
"""
osd_list = []
for osd_name in self.OSDs.keys():
......@@ -89,7 +89,8 @@ class DataDistribution(object):
osd_information=None, ratio_parameter='', capacity='',
ignore_osd_capacities=True,
random_osd_assignment=False,
ignore_folder_sizes=False):
ignore_folder_sizes=False,
debug=False):
# TODO update doc
"""
adds a list of folders to the data distribution.
......@@ -108,14 +109,16 @@ class DataDistribution(object):
else:
new_folders.append(folder)
print("dataDistribution: random_osd_assignment: " + str(random_osd_assignment))
if debug:
print("dataDistribution: random_osd_assignment: " + str(random_osd_assignment))
osds_for_new_folders = []
# totally random OSD assignment, even ignoring OSD capacities
# (might lead to I/O errors when too many groups are assigned to an OSD)
if random_osd_assignment and ignore_osd_capacities:
print("using totally random osd assignment")
if debug:
print("using totally random osd assignment")
for folder in new_folders:
random_osd = random.choice(list(self.OSDs.values()))
random_osd.add_folder(folder.id, folder.size)
......@@ -128,7 +131,8 @@ class DataDistribution(object):
if osd_information is None or ratio_parameter == '':
raise ValueError("ignore_osd_capacities=False is not possible if osd_information or capacity is"
"not given!")
print("using random osd assignment, respecting osd capacities")
if debug:
print("using random osd assignment, respecting osd capacities")
for folder in new_folders:
suitable_osds = [] # list of OSDs with enough capacity
for one_osd in self.OSDs.values():
......
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