mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Remove mistaken commits from other pull request. (#52928)
This commit is contained in:
parent
9f7eb8ee53
commit
96549bf6ff
1 changed files with 28 additions and 21 deletions
|
@ -280,7 +280,10 @@ class RedfishUtils(object):
|
||||||
controller_list = []
|
controller_list = []
|
||||||
controller_results = []
|
controller_results = []
|
||||||
# Get these entries, but does not fail if not found
|
# Get these entries, but does not fail if not found
|
||||||
properties = ['Name', 'Status']
|
properties = ['CacheSummary', 'FirmwareVersion', 'Identifiers',
|
||||||
|
'Location', 'Manufacturer', 'Model', 'Name',
|
||||||
|
'PartNumber', 'SerialNumber', 'SpeedGbps', 'Status']
|
||||||
|
key = "StorageControllers"
|
||||||
|
|
||||||
# Find Storage service
|
# Find Storage service
|
||||||
response = self.get_request(self.root_uri + self.systems_uri)
|
response = self.get_request(self.root_uri + self.systems_uri)
|
||||||
|
@ -288,41 +291,45 @@ class RedfishUtils(object):
|
||||||
return response
|
return response
|
||||||
data = response['data']
|
data = response['data']
|
||||||
|
|
||||||
if 'SimpleStorage' not in data:
|
if 'Storage' not in data:
|
||||||
return {'ret': False, 'msg': "SimpleStorage resource not found"}
|
return {'ret': False, 'msg': "Storage resource not found"}
|
||||||
|
|
||||||
# Get a list of all storage controllers and build respective URIs
|
# Get a list of all storage controllers and build respective URIs
|
||||||
storage_uri = data["SimpleStorage"]["@odata.id"]
|
storage_uri = data['Storage']["@odata.id"]
|
||||||
response = self.get_request(self.root_uri + storage_uri)
|
response = self.get_request(self.root_uri + storage_uri)
|
||||||
if response['ret'] is False:
|
if response['ret'] is False:
|
||||||
return response
|
return response
|
||||||
result['ret'] = True
|
result['ret'] = True
|
||||||
data = response['data']
|
data = response['data']
|
||||||
|
|
||||||
for controller in data[u'Members']:
|
# Loop through Members and their StorageControllers
|
||||||
controller_list.append(controller[u'@odata.id'])
|
# and gather properties from each StorageController
|
||||||
|
if data[u'Members']:
|
||||||
for c in controller_list:
|
for storage_member in data[u'Members']:
|
||||||
controller = {}
|
storage_member_uri = storage_member[u'@odata.id']
|
||||||
uri = self.root_uri + c
|
response = self.get_request(self.root_uri + storage_member_uri)
|
||||||
response = self.get_request(uri)
|
|
||||||
if response['ret'] is False:
|
|
||||||
return response
|
|
||||||
data = response['data']
|
data = response['data']
|
||||||
|
|
||||||
|
if key in data:
|
||||||
|
controller_list = data[key]
|
||||||
|
for controller in controller_list:
|
||||||
|
controller_result = {}
|
||||||
for property in properties:
|
for property in properties:
|
||||||
if property in data:
|
if property in controller:
|
||||||
controller[property] = data[property]
|
controller_result[property] = controller[property]
|
||||||
controller_results.append(controller)
|
controller_results.append(controller_result)
|
||||||
result["entries"] = controller_results
|
result['entries'] = controller_results
|
||||||
return result
|
return result
|
||||||
|
else:
|
||||||
|
return {'ret': False, 'msg': "Storage resource not found"}
|
||||||
|
|
||||||
def get_disk_inventory(self):
|
def get_disk_inventory(self):
|
||||||
result = {}
|
result = {}
|
||||||
controller_list = []
|
controller_list = []
|
||||||
disk_results = []
|
disk_results = []
|
||||||
# Get these entries, but does not fail if not found
|
# Get these entries, but does not fail if not found
|
||||||
properties = ['Name', 'Manufacturer', 'Model', 'Status', 'CapacityBytes']
|
properties = ['Name', 'Manufacturer', 'Model', 'Status',
|
||||||
|
'CapacityBytes']
|
||||||
|
|
||||||
# Find Storage service
|
# Find Storage service
|
||||||
response = self.get_request(self.root_uri + self.systems_uri)
|
response = self.get_request(self.root_uri + self.systems_uri)
|
||||||
|
|
Loading…
Reference in a new issue