Verified Commit 124641cf authored by Marco Marinello's avatar Marco Marinello
Browse files

Cannot handle list of components as dictionary

parent a7b2f773
......@@ -33,6 +33,13 @@ def filter_by_list(list, query):
return result
def to_dict(cList):
out = {}
for i in cList:
out[i.name] = i.value
return out
def add_info(_disks, disk, info, index):
disks = []
ADDED = False
......@@ -141,9 +148,11 @@ def parse_wan_mac(components):
def parse_etc(components):
if "etc_segments" not in components:
q = filter(components, "etc_segments")
if not q:
return None
segments = int(components["etc_segments"])
this = to_dict(q)
segments = int(this["etc_segments"])
j = ""
for i in range(segments):
j += components["etc_segment%s" % i]
......
Markdown is supported
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