From 07c1d7e1ca41431cd5c959c36496788c73b1e3b8 Mon Sep 17 00:00:00 2001 From: rahushen Date: Thu, 31 Aug 2017 14:59:14 -0400 Subject: [PATCH] update nxos_facts to handle n3k power table (#28891) * handle power table for n3k --- lib/ansible/modules/network/nxos/nxos_facts.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/nxos/nxos_facts.py b/lib/ansible/modules/network/nxos/nxos_facts.py index 4c633e7f651..24da20f2b3a 100644 --- a/lib/ansible/modules/network/nxos/nxos_facts.py +++ b/lib/ansible/modules/network/nxos/nxos_facts.py @@ -431,7 +431,10 @@ class Legacy(FactsBase): return objects 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)) return objects