Skip to content

Commit 491c004

Browse files
committed
version 5.0.0.0
1 parent 7d6db34 commit 491c004

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
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__ = "4.9.0.0"
4+
__version__ = "5.0.0.0"
55

66
import logging
77

src/redfish/hpilo/risblobstore2.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ def initializecreds(username=None, password=None, log_dir=None):
912912

913913
dll = BlobStore2.gethprestchifhandle()
914914
if LOGGER.isEnabledFor(logging.DEBUG):
915-
logdir_c = create_string_buffer(log_dir.encode('UTF-8'))
915+
logdir_c = create_string_buffer(log_dir.encode('utf-8'))
916916
dll.enabledebugoutput(logdir_c)
917917
dll.ChifInitialize(None)
918918
if username:
@@ -925,16 +925,14 @@ def initializecreds(username=None, password=None, log_dir=None):
925925
usernew = create_string_buffer(username.encode("utf-8"))
926926
passnew = create_string_buffer(password.encode("utf-8"))
927927

928-
# LOGGER.debug("Calling initiate_credentials...")
929928
dll.initiate_credentials(usernew, passnew)
930-
# LOGGER.debug("Calling ChifVerifyCredentials...")
931929
credreturn = dll.ChifVerifyCredentials()
932930
if not credreturn == BlobReturnCodes.SUCCESS:
933931
if credreturn == hpiloreturncodes.CHIFERR_AccessDenied:
934932
raise Blob2SecurityError()
935933
else:
936934
raise HpIloInitialError(
937-
"Error %s occurred while trying " "to open a channel to iLO" % credreturn
935+
"Error %s occurred while trying to open a channel to iLO" % credreturn
938936
)
939937
else:
940938
dll.ChifDisableSecurity()

src/redfish/rest/connections.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ def rest_request(self, path="", method="GET", args=None, body=None, headers=None
450450
if isinstance(body, bytes):
451451
body = body.decode("utf-8")
452452
body = json.dumps(body)
453+
elif isinstance(body, bytes):
454+
headers["Content-Type"] = "application/octet-stream"
455+
body = bytearray(body)
453456
else:
454457
headers["Content-Type"] = "application/x-www-form-urlencoded"
455458
body = urlencode(body)
@@ -495,12 +498,14 @@ def rest_request(self, path="", method="GET", args=None, body=None, headers=None
495498

496499
if body and len(body) > 0:
497500
if isinstance(body, bytearray):
498-
str1 = bytearray(str1.encode("ASCII")) + body
501+
str1 = bytearray(str1.encode("utf-8")) + body
499502
else:
503+
#if isinstance(body, bytes):
504+
# body = body.decode("utf-8")
500505
str1 += body
501506

502507
if not isinstance(str1, bytearray):
503-
str1 = bytearray(str1.encode("ASCII"))
508+
str1 = bytearray(str1.encode("utf-8"))
504509

505510
if LOGGER.isEnabledFor(logging.DEBUG):
506511
try:

src/redfish/rest/containers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,11 @@ def __init__(self, rest_request, resp_txt):
313313
resp_txt = "".join(map(chr, resp_txt))
314314
self._respfh = StringIO(resp_txt)
315315
self._socket = _FakeSocket(bytearray(list(map(ord, self._respfh.read()))))
316+
#self._respfh = BytesIO(resp_txt.encode('utf-8'))
317+
#self._socket = _FakeSocket(bytearray(self._respfh.read()))
316318

317319
response = http_client.HTTPResponse(self._socket)
320+
#response = response.decode('utf-8')
318321
response.begin()
319322
response.data = response.read()
320323
response.headers = {ki[0]: ki[1] for ki in response.getheaders()}

0 commit comments

Comments
 (0)