Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
FUSS
octomon
Commits
124641cf
Unverified
Commit
124641cf
authored
Mar 23, 2019
by
Marco Marinello
Browse files
Cannot handle list of components as dictionary
parent
a7b2f773
Changes
1
Hide whitespace changes
Inline
Side-by-side
hosts/utils.py
View file @
124641cf
...
...
@@ -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
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment