gpt4 book ai didi

python - 通过 Python iLO REST 客户端连接到 HPE iLO 5 时出现 RetriesExhaustedError

转载 作者:太空宇宙 更新时间:2023-11-03 21:33:40 26 4
gpt4 key购买 nike

以下是基于 Python 的 RESTful 库客户端(HP 推荐 https://developer.hpe.com/platform/ilo-restful-api/home ),它使用 Redfish REST API ( https://github.com/HewlettPackard/python-ilorest-library ) 连接到基于 ProLiant DL360 Gen10 的硬件的远程 HPE iLO5 服务器

#! /usr/bin/python
import redfish

iLO_host = "https://xx.xx.xx.xx"
username = "admin"
password = "xxxxxx"

# 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()

创建 REST 对象时遇到 RetriesExhaustedError。但是,我可以从运行此脚本的 VM (RHEL7.4) 成功通过 SSH 连接到服务器。正确提供了身份验证详细信息。我确认在 iLO 安全 - 访问设置中启用了 Web 服务器(端口 443 和 80)。另外,在我的虚拟机中,Firewalld 服务已停止,IPTables 已刷新。但仍然无法建立连接。我还可以尝试哪些其他可能性?

最佳答案

我找到了根本原因。问题在于 SSL 证书验证是由 Python 代码完成的。在运行解决问题的代码之前,可以通过设置环境变量 PYTHONHTTPSVERIFY=0 来关闭此功能。

关于python - 通过 Python iLO REST 客户端连接到 HPE iLO 5 时出现 RetriesExhaustedError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53376129/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com