Skip to content
Permalink
Browse files

fix: better error messages for check-boot on non-supported

if BootSources redfish API entrypoint is not available, none of
of the boot order operations can be executed on the host.

fixes: #48
  • Loading branch information...
grafuls committed Oct 7, 2019
1 parent 10a44c9 commit bd3d2a2e0bd5b0e602075590b6ba6d81a38b38fb
Showing with 5 additions and 0 deletions.
  1. +5 −0 badfish.py
@@ -144,6 +144,11 @@ def get_boot_devices(self):
_uri = "%s%s/BootSources" % (self.host_uri, self.system_resource)
_response = self.get_request(_uri)

if _response.status_code == 404:
self.logger.debug(_response.text)
self.logger.error("Boot order modification is not supported by this host.")
sys.exit(1)

data = _response.json()
if "Attributes" in data:
return data[u"Attributes"][_boot_seq]

0 comments on commit bd3d2a2

Please sign in to comment.
You can’t perform that action at this time.