Skip to content

Commit

Permalink
FabricDetails(): Get fabric_name from nvPairs.FABRIC_NAME rather than…
Browse files Browse the repository at this point in the history
… fabricName, more...

Since nvPairs.FABRIC_NAME is documented and fabricName is not, prefer the documented key/value.

Also:

FabricDetails()._get() - signature in parent class overridden method needs to match that of subclass.

FabricDetails()._get_nv_pair() - signature in parent class overridden method needs to match that of subclass.
  • Loading branch information
allenrobel committed Apr 22, 2024
1 parent f016475 commit 788088d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/module_utils/fabric/fabric_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ def refresh_super(self):
self._update_results()
return
for item in self.rest_send.response_current.get("DATA"):
self.data[item["fabricName"]] = item
fabric_name = item.get("nvPairs", {}).get("FABRIC_NAME", None)
if fabric_name is None:
self._update_results()
return
self.data[fabric_name] = item

msg = f"self.data: {json.dumps(self.data, indent=4, sort_keys=True)}"
self.log.debug(msg)
Expand All @@ -117,12 +121,12 @@ def refresh_super(self):

self._update_results()

def _get(self, item=None):
def _get(self, item):
"""
overridden in subclasses
"""

def _get_nv_pair(self, item=None):
def _get_nv_pair(self, item):
"""
overridden in subclasses
"""
Expand Down

0 comments on commit 788088d

Please sign in to comment.