handle multiple WMI objects
This commit is contained in:
parent
66107940a2
commit
3b579a97d9
|
|
@ -63,12 +63,16 @@ class Agent(object):
|
|||
wmi_details = {}
|
||||
pass
|
||||
wmi_dict = {}
|
||||
wmi_dict_keys = []
|
||||
for k, v in wmi_details.items():
|
||||
try:
|
||||
value = v[0][0]
|
||||
except IndexError:
|
||||
value = dict()
|
||||
wmi_dict[k] = value
|
||||
for index, item in enumerate(v):
|
||||
try:
|
||||
value = item[0]
|
||||
except IndexError:
|
||||
value = dict()
|
||||
new_key = k + str(index)
|
||||
wmi_dict[new_key] = value
|
||||
wmi_dict_keys.append(new_key)
|
||||
return wmi_dict
|
||||
|
||||
def get_agent_metrics(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue