question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Local Redfish does not correctly transition between bytes and string in Python 3

See original GitHub issue

Hi,

I’m trying to use this library for monitoring the health of some servers I’m using. I began adapting the simple redfish-quickstart file that’s available under the examples directory. As per instructions, I also have hprest_chif.so available on my system. The relevant part of the script is below:

import redfish

# When running on the server locally use the following commented values
iLO_host = "blobstore://."
iLO_account = "None"
iLO_password = "None"


redfish_obj = redfish.redfish_client(base_url=iLO_host,
                                     username=iLO_host,
                                     password=iLO_password)

redfish_obj.login(auth="session")

When I try to run this with python3.6, I get the following errors:

Traceback (most recent call last): 
  File "/usr/lib/python3.6/site-packages/redfish/rest/v1.py", line 955, in __init__
    password=password) 
  File "/usr/lib/python3.6/site-packages/redfish/hpilo/risblobstore2.py", line 858, in initializecreds
    dll = BlobStore2.gethprestchifhandle()
  File "/usr/lib/python3.6/site-packages/redfish/hpilo/risblobstore2.py", line 837, in gethprestchifhandle
    raise ChifDllMissingError(excp)
redfish.hpilo.risblobstore2.ChifDllMissingError: '_Environ' object has no attribute 'has_key'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "check_memory_status.py", line 16, in <module>
    password=iLO_password)
  File "/usr/lib/python3.6/site-packages/redfish/rest/v1.py", line 1226, in get_client_instance
    is_redfish=is_redfish, cache=cache, proxy=proxy)
  File "/usr/lib/python3.6/site-packages/redfish/rest/v1.py", line 966, in __init__
    if excp.message == 'chif': 
AttributeError: 'ChifDllMissingError' object has no attribute 'message'

When I try running with python 2.7:

Traceback (most recent call last): 
  File "check_memory_status.py", line 16, in <module>
    password=iLO_password) 
  File "/usr/lib/python2.7/site-packages/redfish/rest/v1.py", line 1226, in get_client_instance
    is_redfish=is_redfish, cache=cache, proxy=proxy)
  File "/usr/lib/python2.7/site-packages/redfish/rest/v1.py", line 955, in __init__
    password=password)
  File "/usr/lib/python2.7/site-packages/redfish/hpilo/risblobstore2.py", line 858, in initializecreds
    dll = BlobStore2.gethprestchifhandle()
  File "/usr/lib/python2.7/site-packages/redfish/hpilo/risblobstore2.py", line 835, in gethprestchifhandle
    BlobStore2.setglobalhprestchifrandnumber(libhandle)
  File "/usr/lib/python2.7/site-packages/redfish/hpilo/risblobstore2.py", line 846, in setglobalhprestchifrandnumber
    libbhndl.updaterandval.argtypes = [c_ushort]
  File "/usr/lib64/python2.7/ctypes/__init__.py", line 373, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib64/python2.7/ctypes/__init__.py", line 378, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self)) 
AttributeError: /lib64/hprest_chif.so: undefined symbol: updaterandval

Remote connections (using an explicit IP address) to connect to the iLO works fine but I want to avoid using hardcoded IPs and account credentials in my script. Any help to fix these issues would be greatly appreciated.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Yergidycommented, Aug 9, 2019

@rirze A fix for the local python 3 issues have been committed. Please pull the master and see if that fixes your issue. https://github.com/HewlettPackard/python-ilorest-library/commit/1b02fad86ebe6a8e681d791fe7838104f2a6d371

1reaction
Yergidycommented, Jul 22, 2019

@rirze Yes. We are working on a fix now. I will update the issue once it has been addressed. In the meantime, if you need it to work now, can you try running it with the latest Python 2?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Converting integer to byte string problem in python 3
I have a library function that is failing because I cannot seem to properly convert an integer to a proper byte string except...
Read more >
Overview – RESTful Interface Tool 3.2.2 User Guide
An issue with downloading AHS when iLOREST is running locally on a server. The privilege modification of an iLO user account that was...
Read more >
Common migration problems — Supporting Python 3
So taking one character of a string will return a one-character long string, but taking one byte of a bytes object will return...
Read more >
oVirt 4.4.0 Release Notes
oVirt is a free open-source virtualization solution for your entire enterprise.
Read more >
Server Configuration Profiles - Reference Guide - Dell
The information in this publication is provided “as is.” Dell Inc. makes no representations or warranties of any kind with respect to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found