Use root user for serial loopback, Admin for network connections
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -396,7 +396,8 @@ def _redfish_request(password: str, method: str, path: str,
|
|||||||
Returns (success: bool, data: dict|str).
|
Returns (success: bool, data: dict|str).
|
||||||
"""
|
"""
|
||||||
url = f"https://{host}{path}"
|
url = f"https://{host}{path}"
|
||||||
credentials = b64encode(f"Admin:{password}".encode()).decode()
|
username = "root" if host == "127.0.0.1" else "Admin"
|
||||||
|
credentials = b64encode(f"{username}:{password}".encode()).decode()
|
||||||
ctx = ssl.create_default_context()
|
ctx = ssl.create_default_context()
|
||||||
ctx.check_hostname = False
|
ctx.check_hostname = False
|
||||||
ctx.verify_mode = ssl.CERT_NONE
|
ctx.verify_mode = ssl.CERT_NONE
|
||||||
@@ -452,7 +453,7 @@ def _redfish_upload_firmware(password: str, host: str, fw_path: str) -> tuple:
|
|||||||
).encode() + file_data + f"\r\n--{boundary}--\r\n".encode()
|
).encode() + file_data + f"\r\n--{boundary}--\r\n".encode()
|
||||||
|
|
||||||
url = f"https://{host}/redfish/v1/UpdateService"
|
url = f"https://{host}/redfish/v1/UpdateService"
|
||||||
credentials = b64encode(f"Admin:{password}".encode()).decode()
|
credentials = b64encode(f"Admin:{password}".encode()).decode() # always network
|
||||||
ctx = ssl.create_default_context()
|
ctx = ssl.create_default_context()
|
||||||
ctx.check_hostname = False
|
ctx.check_hostname = False
|
||||||
ctx.verify_mode = ssl.CERT_NONE
|
ctx.verify_mode = ssl.CERT_NONE
|
||||||
|
|||||||
Reference in New Issue
Block a user