update nxos_facts to handle n3k power table (#28891)

* handle power table for n3k
This commit is contained in:
rahushen 2017-08-31 14:59:14 -04:00 committed by Nathaniel Case
parent c7c30c6760
commit 07c1d7e1ca

View file

@ -431,7 +431,10 @@ class Legacy(FactsBase):
return objects return objects
def parse_power_supply_info(self, data): def parse_power_supply_info(self, data):
data = data['powersup']['TABLE_psinfo']['ROW_psinfo'] if data.get('powersup').get('TABLE_psinfo_n3k'):
data = data['powersup']['TABLE_psinfo_n3k']['ROW_psinfo_n3k']
else:
data = data['powersup']['TABLE_psinfo']['ROW_psinfo']
objects = list(self.transform_iterable(data, self.POWERSUP_MAP)) objects = list(self.transform_iterable(data, self.POWERSUP_MAP))
return objects return objects