Skip to content

Commit

Permalink
Now that we check all chassis and not only the first one,
Browse files Browse the repository at this point in the history
we might find entries that do not have any links associated
  • Loading branch information
BerndKue committed Oct 31, 2024
1 parent d88e81c commit dcbea32
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions redfish_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,11 @@ def _get_chassis_urls(self):
if url in chassi_info:
self._urls[url].append(chassi_info[url]['@odata.id'])
# Dell iDRAC has some of the URLs in the links section, e.g. PCIeDevices
elif url in chassi_info['Links'] and chassi_info['Links'][url] != []:
elif (
'Links' in chassi_info and
url in chassi_info['Links'] and
chassi_info['Links'][url] != []
):
for entry in chassi_info['Links'][url]:
if isinstance(entry, str):
link = entry
Expand All @@ -387,9 +391,10 @@ def _get_chassis_urls(self):
self._urls[url].append(link)
else:
logging.warning(
" Target %s: No %s URL found in Chassi info!",
" Target %s: No %s URL found in Chassi info for Chassis %s!",
self.target,
url
url,
chassi_info['Name']
)

def _get_urls(self, url):
Expand Down

0 comments on commit dcbea32

Please sign in to comment.