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:
2026-03-06 15:56:35 -05:00
parent 73802ad96c
commit ae415f89e1

View File

@@ -396,7 +396,8 @@ def _redfish_request(password: str, method: str, path: str,
Returns (success: bool, data: dict|str).
"""
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.check_hostname = False
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()
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.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE