forked from dell/iDRAC-Redfish-Scripting
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added check for iDRAC creds validation
- Loading branch information
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# GetRemoteServicesAPIStatusREDFISH. Python script using Redfish API with OEM extension to get the server remote services status | ||
# | ||
# _author_ = Texas Roemer <[email protected]> | ||
# _version_ = 1.0 | ||
# _version_ = 2.0 | ||
# | ||
# Copyright (c) 2019, Dell, Inc. | ||
# | ||
|
@@ -43,6 +43,9 @@ def check_supported_idrac_version(): | |
except: | ||
print("\n- FAIL, either incorrect iDRAC username / password passed in or iDRAC user doesn't have correct privileges") | ||
sys.exit() | ||
if response.status_code == 401: | ||
print("\n- WARNING, status code 401 detected, check iDRAC username / password credentials") | ||
sys.exit() | ||
if response.status_code != 200: | ||
print("\n- WARNING, iDRAC version installed does not support this feature using Redfish API") | ||
sys.exit() | ||
|