apply ruff

This commit is contained in:
2026-01-21 08:35:27 +01:00
parent 846ce706b6
commit b1e5369a33
2 changed files with 43 additions and 16 deletions

View File

@@ -18,7 +18,7 @@ def get_power_data(host):
vendor = data.get("Vendor", "")
is_hpe = vendor.strip().upper().startswith("HPE")
if is_hpe:
response = "" # just to be sure
response = "" # just to be sure
login_url = f"https://{host}.mgmt.wtb1.ch.abainfra.net/redfish/v1/SessionService/Sessions"
payload = {"UserName": username, "Password": password}
response = requests.post(login_url, json=payload, verify=False, timeout=10)
@@ -49,7 +49,7 @@ def get_power_data(host):
watts_input = psu.get("PowerInputWatts")
serial = psu.get("SerialNumber")
print(
f"PSU {idx}, {serial}: {host}, {line_input_v} V, {watts_input} W, {round(watts_input/line_input_v,2)} A"
f"PSU {idx}, {serial}: {host}, {line_input_v} V, {watts_input} W, {round(watts_input / line_input_v, 2)} A"
)
else:
print(f"Error {response.status_code}: {response.text}")