从python-ilorest-library == 2.4.2升级到python-ilorest-library == 2.5.0。
以下代码在v2.4.2及更低版本中适用。在v2.5.0中失败
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import redfish
iLO_host = "https://xxx.xxx.xxx.xxx"
username = "admin"
password = "********"
# Create a REST object
REST_OBJ = redfish.redfish_client(base_url=iLO_host,
username=username,
password=password,
default_prefix='/redfish/v1'
)
# Login into the server and create a session
REST_OBJ.login(auth="session")
# HTTP GET request
response = REST_OBJ.get("/redfish/v1/systems/1", None)
print(response)
REST_OBJ.logout()
回溯(最近通话最近一次):
文件“ ./base_test.py”,第18行,位于
REST_OBJ.login(auth =“ session”)
文件“ /opt/conda/lib/python3.6/site-packages/redfish/rest/v1.py”,第892行,处于登录状态
LOGGER.info(json.loads('%s', resp.read))
TypeError:loads()带有1个位置参数,但给出了2个