Skip to content

Commit

Permalink
Version 5.3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeevkallur committed Oct 12, 2024
1 parent 38c711d commit a777c70
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/redfish/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" Redfish restful library """

__all__ = ["rest", "ris", "hpilo"]
__version__ = "5.2.0.0"
__version__ = "5.3.0.0"

import logging

Expand Down
4 changes: 3 additions & 1 deletion src/redfish/hpilo/rishpilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ def __init__(self, dll=None, log_dir=None):
if status != BlobReturnCodes.SUCCESS:
errmsg = "Error {0} occurred while trying to open a " "channel to iLO".format(status)
if status == BlobReturnCodes.CHIFERR_NoDriver:
errmsg = "chif"
errmsg = "No devices were found."
if os.name != "nt":
errmsg = "{0} Ensure the hpilo kernel module is loaded.".format(errmsg)
elif status == BlobReturnCodes.CHIFERR_AccessDenied:
errmsg = "You must be root/Administrator to use this program."
raise HpIloInitialError(errmsg)
Expand Down
15 changes: 9 additions & 6 deletions src/redfish/rest/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,15 @@ def _session_login(self):
else:
self.session_key = self.connection.session_key

if "OneTimePasscodeSent" in self.login_response:
raise OneTimePasscodeError()
elif "UnauthorizedLogin" in self.login_response:
raise UnauthorizedLoginAttemptError("Error "+str(self.login_return_code)+". Login is unauthorized.\nPlease check the credentials/OTP entered.\n")
elif "TokenExpired" in self.login_response:
raise TokenExpiredError("Error "+str(self.login_return_code)+". The OTP entered has expired. Please enter credentials again.\n")
if hasattr(self, "login_response") and self.login_response:
if "OneTimePasscodeSent" in self.login_response:
raise OneTimePasscodeError()
elif "UnauthorizedLogin" in self.login_response:
raise UnauthorizedLoginAttemptError("Error " + str(
self.login_return_code) + ". Login is unauthorized.\nPlease check the credentials/OTP entered.\n")
elif "TokenExpired" in self.login_response:
raise TokenExpiredError("Error " + str(
self.login_return_code) + ". The OTP entered has expired. Please enter credentials again.\n")
elif not self.session_key and not resp.status == 200:
self._credential_err()
else:
Expand Down
5 changes: 4 additions & 1 deletion src/redfish/ris/resp_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ def verbosity_levels(
+ "\n"
)
else:
return ""
if response_status == 400:
return "" + message + "\n"
else:
return ""

# unused? (removal pending)
@staticmethod
Expand Down
14 changes: 11 additions & 3 deletions src/redfish/ris/rmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,9 +773,10 @@ def commit(self):
merge_dict(totpayload, payload)
currdict = copy.deepcopy(totpayload)
if "PersistentBootConfigOrder" in currdict and type(currdict) is dict:
currdict = list(set(currdict["PersistentBootConfigOrder"]))
default_value = 0
currdict = {key: default_value for key in currdict}
refdict = list(set(currdict["PersistentBootConfigOrder"]))
items = list(currdict["PersistentBootConfigOrder"])
items_to_keep = items[: int(len(refdict))]
currdict = {"PersistentBootConfigOrder": items_to_keep}
if currdict:
yield instance.resp.request.path

Expand Down Expand Up @@ -905,6 +906,13 @@ def get_handler(
results = self.current_client.get(get_path, headers=headers)

if results and getattr(results, "status", None) and results.status == 404:
if not silent:
if hasattr(self.typepath.defs, "messageregistrytype"):
ResponseHandler(self.validationmanager, self.typepath.defs.messageregistrytype).output_resp(
results, dl_reg=service, verbosity=self.verbose
)
else:
print_handler("[" + str(results.status) + "]" + " The operation completed successfully.\n")
return results

if results and results.status == 200 and sessionid:
Expand Down

0 comments on commit a777c70

Please sign in to comment.