Skip to content

Commit a777c70

Browse files
committed
Version 5.3.0.0
1 parent 38c711d commit a777c70

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

src/redfish/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
""" Redfish restful library """
22

33
__all__ = ["rest", "ris", "hpilo"]
4-
__version__ = "5.2.0.0"
4+
__version__ = "5.3.0.0"
55

66
import logging
77

src/redfish/hpilo/rishpilo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ def __init__(self, dll=None, log_dir=None):
135135
if status != BlobReturnCodes.SUCCESS:
136136
errmsg = "Error {0} occurred while trying to open a " "channel to iLO".format(status)
137137
if status == BlobReturnCodes.CHIFERR_NoDriver:
138-
errmsg = "chif"
138+
errmsg = "No devices were found."
139+
if os.name != "nt":
140+
errmsg = "{0} Ensure the hpilo kernel module is loaded.".format(errmsg)
139141
elif status == BlobReturnCodes.CHIFERR_AccessDenied:
140142
errmsg = "You must be root/Administrator to use this program."
141143
raise HpIloInitialError(errmsg)

src/redfish/rest/v1.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,15 @@ def _session_login(self):
478478
else:
479479
self.session_key = self.connection.session_key
480480

481-
if "OneTimePasscodeSent" in self.login_response:
482-
raise OneTimePasscodeError()
483-
elif "UnauthorizedLogin" in self.login_response:
484-
raise UnauthorizedLoginAttemptError("Error "+str(self.login_return_code)+". Login is unauthorized.\nPlease check the credentials/OTP entered.\n")
485-
elif "TokenExpired" in self.login_response:
486-
raise TokenExpiredError("Error "+str(self.login_return_code)+". The OTP entered has expired. Please enter credentials again.\n")
481+
if hasattr(self, "login_response") and self.login_response:
482+
if "OneTimePasscodeSent" in self.login_response:
483+
raise OneTimePasscodeError()
484+
elif "UnauthorizedLogin" in self.login_response:
485+
raise UnauthorizedLoginAttemptError("Error " + str(
486+
self.login_return_code) + ". Login is unauthorized.\nPlease check the credentials/OTP entered.\n")
487+
elif "TokenExpired" in self.login_response:
488+
raise TokenExpiredError("Error " + str(
489+
self.login_return_code) + ". The OTP entered has expired. Please enter credentials again.\n")
487490
elif not self.session_key and not resp.status == 200:
488491
self._credential_err()
489492
else:

src/redfish/ris/resp_handler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,10 @@ def verbosity_levels(
283283
+ "\n"
284284
)
285285
else:
286-
return ""
286+
if response_status == 400:
287+
return "" + message + "\n"
288+
else:
289+
return ""
287290

288291
# unused? (removal pending)
289292
@staticmethod

src/redfish/ris/rmc.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,9 +773,10 @@ def commit(self):
773773
merge_dict(totpayload, payload)
774774
currdict = copy.deepcopy(totpayload)
775775
if "PersistentBootConfigOrder" in currdict and type(currdict) is dict:
776-
currdict = list(set(currdict["PersistentBootConfigOrder"]))
777-
default_value = 0
778-
currdict = {key: default_value for key in currdict}
776+
refdict = list(set(currdict["PersistentBootConfigOrder"]))
777+
items = list(currdict["PersistentBootConfigOrder"])
778+
items_to_keep = items[: int(len(refdict))]
779+
currdict = {"PersistentBootConfigOrder": items_to_keep}
779780
if currdict:
780781
yield instance.resp.request.path
781782

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

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

910918
if results and results.status == 200 and sessionid:

0 commit comments

Comments
 (0)