FIX REDFISH_SUPPORT_TRANS_STATE not defined in DVT environment.
Signed-off-by: Michael Shepos <shepos@us.ibm.com>
Change-Id: Ie98c13dbf7b27ce52cbfc55abacf6a1568a32e02
diff --git a/bin/plug_ins/Auto_reboot/cp_master b/bin/plug_ins/Auto_reboot/cp_master
index 8dd9e0e..ac1eadb 100755
--- a/bin/plug_ins/Auto_reboot/cp_master
+++ b/bin/plug_ins/Auto_reboot/cp_master
@@ -6,6 +6,7 @@
import os
import sys
+import time
save_dir_path = sys.path.pop(0)
@@ -34,7 +35,6 @@
AUTO_REBOOT_DISABLE = "1"
-
def validate_parms():
r"""
@@ -67,6 +67,9 @@
lib_file_path = init_robot_file_path("lib/utils.robot")
+ REDFISH_SUPPORT_TRANS_STATE = int(os.environ.get('REDFISH_SUPPORT_TRANS_STATE', 0)) or \
+ int(os.environ.get('AUTOBOOT_REDFISH_SUPPORT_TRANS_STATE', 0))
+
enable_auto_reboot = 1 - AUTO_REBOOT_DISABLE
print_var(enable_auto_reboot)
keyword_string = "Set Auto Reboot Setting ${%i}" % enable_auto_reboot
@@ -76,9 +79,14 @@
REDFISH_SUPPORT_TRANS_STATE, keyword_string, lib_file_path, quiet,
test_mode, debug, outputdir, output, log, report)
- if not robot_cmd_fnc(cmd_buf):
- print_error_report("Robot command execution failed.")
- exit(1)
+ retry_count = 3
+ while not robot_cmd_fnc(cmd_buf):
+ retry_count -= 1
+ if retry_count == 0:
+ print_error_report("Robot command execution failed.")
+ exit(1)
+ time.sleep(30)
+ return
main()