Change SystemCollection from list to dict
- Change systems_list to systems_dict["<index>"] . The systems_dict will contain system objects, <index> is the redfish <index> as reported inside url.
This commit is contained in:
@@ -247,8 +247,6 @@ class RedfishConnection(object):
|
||||
self.connection_parameters
|
||||
)
|
||||
|
||||
#for system in self.Systems.systems_list:
|
||||
#config.logger.debug(system.data.links.ManagedBy)
|
||||
# self.Chassis
|
||||
|
||||
# self.EventService
|
||||
|
||||
@@ -428,11 +428,12 @@ class SystemsCollection(BaseCollection):
|
||||
'''Class to manage redfish SystemsCollection data.'''
|
||||
def __init__(self, url, connection_parameters):
|
||||
super(SystemsCollection, self).__init__(url, connection_parameters)
|
||||
|
||||
self.systems_list = []
|
||||
|
||||
|
||||
self.systems_dict = {}
|
||||
|
||||
for link in self.links:
|
||||
self.systems_list.append(Systems(link, connection_parameters))
|
||||
index = re.search(r'Systems/(\w+)', link)
|
||||
self.systems_dict[index.group(1)] = Systems(link, connection_parameters)
|
||||
|
||||
|
||||
class Bios(Base):
|
||||
|
||||
Reference in New Issue
Block a user