apply ruff
This commit is contained in:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user