mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
GetManagerNicInventory (#49961)
* Add GetManagerNicInventory command for Manager category, and tweak redfish_utils' get_nic_inventory to accommodate manager nic interfaces * Remove get_manager_nic_inventory, since it is unnecessary while using get_manager in get_nic_inventory * Rework get_nic_inventory() to take a resource_type as a string, which will be just the category parameter from redfish_facts, making it clearer * remove extraneous blank line to conform with pep8 * Add GetManagerNicInventory example task to EXAMPLES docstring
This commit is contained in:
parent
15d39f9108
commit
1e415899ad
2 changed files with 20 additions and 5 deletions
|
@ -833,7 +833,7 @@ class RedfishUtils(object):
|
|||
result["entries"] = cpu_results
|
||||
return result
|
||||
|
||||
def get_nic_inventory(self):
|
||||
def get_nic_inventory(self, resource_type):
|
||||
result = {}
|
||||
nic_list = []
|
||||
nic_results = []
|
||||
|
@ -843,8 +843,13 @@ class RedfishUtils(object):
|
|||
'NameServers', 'PermanentMACAddress', 'SpeedMbps', 'MTUSize',
|
||||
'AutoNeg', 'Status']
|
||||
|
||||
# Search for 'key' entry and extract URI from it
|
||||
response = self.get_request(self.root_uri + self.systems_uri)
|
||||
# Given resource_type, use the proper URI
|
||||
if resource_type == 'Systems':
|
||||
resource_uri = self.systems_uri
|
||||
elif resource_type == 'Manager':
|
||||
resource_uri = self.manager_uri
|
||||
|
||||
response = self.get_request(self.root_uri + resource_uri)
|
||||
if response['ret'] is False:
|
||||
return response
|
||||
result['ret'] = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue