|
|
|
@ -822,10 +822,16 @@ class Legacy(FactsBase):
|
|
|
|
|
|
|
|
|
|
|
|
def parse_structured_power_supply_info(self, data):
|
|
|
|
def parse_structured_power_supply_info(self, data):
|
|
|
|
if data.get('powersup').get('TABLE_psinfo_n3k'):
|
|
|
|
if data.get('powersup').get('TABLE_psinfo_n3k'):
|
|
|
|
data = data['powersup']['TABLE_psinfo_n3k']['ROW_psinfo_n3k']
|
|
|
|
fact = data['powersup']['TABLE_psinfo_n3k']['ROW_psinfo_n3k']
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
data = data['powersup']['TABLE_psinfo']['ROW_psinfo']
|
|
|
|
if isinstance(data['powersup']['TABLE_psinfo'], list):
|
|
|
|
objects = list(self.transform_iterable(data, self.POWERSUP_MAP))
|
|
|
|
fact = []
|
|
|
|
|
|
|
|
for i in data['powersup']['TABLE_psinfo']:
|
|
|
|
|
|
|
|
fact.append(i['ROW_psinfo'])
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
fact = data['powersup']['TABLE_psinfo']['ROW_psinfo']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
objects = list(self.transform_iterable(fact, self.POWERSUP_MAP))
|
|
|
|
return objects
|
|
|
|
return objects
|
|
|
|
|
|
|
|
|
|
|
|
def parse_hostname(self, data):
|
|
|
|
def parse_hostname(self, data):
|
|
|
|
|