if __name__ == "__main__":
# When running on the server locally use the following commented values
# iLO_https_url = "blobstore://."
# iLO_account = "None"
# iLO_password = "None"
# When running remotely connect using the iLO secured (https://) address,
# iLO account name, and password to send https requests
# iLO_https_url acceptable examples:
# "https://10.0.0.100"
# "https://f250asha.americas.hpqcorp.net"
iLO_https_url = "https://10.0.0.100"
iLO_account = "admin"
iLO_password = "password"
# Create a REDFISH object
try:
REDFISH_OBJ = RedfishObject(iLO_https_url, iLO_account, iLO_password)
except ServerDownOrUnreachableError as excp:
sys.stderr.write("ERROR: server not reachable or doesn't support " \
"RedFish.\n")
sys.exit()
except Exception as excp:
raise excp
ex4_reset_server(REDFISH_OBJ)
REDFISH_OBJ.redfish_client.logout()
Above is the "login" part of the script im writing. In this part, REDFISH_OBJ = RedfishObject(iLO_https_url, iLO_account, iLO_password), I would like to replace iLO_https_url with a variable whose value would be pulled from a simple CSV file. The CSV would have 3 columns...ip, username,pwd.
I'm trying to execute the other part of the script, not shown here, on every IP in the CSV file. I need to do this in python.