Support boot call point and plugin script for auto reboot function

Changes:
     - Add a robot keyword to map to redfish string values if REST
       is disabled.
       The dictionary {'1': 'RetryAttempts', '0': 'Disabled'}

Tested:
    - Only redfish enabled build.
    - Redfish and REST enabled build.

Change-Id: Ie5093ff89fcb1b471f5f84e783ef55f30f5f5168
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 1c878c9..d37803e 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -675,6 +675,25 @@
     ...  valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
 
 
+Set Auto Reboot Setting
+    [Documentation]  Set the given auto reboot setting (REST or Redfish).
+    [Arguments]  ${value}
+
+    # Description of argument(s):
+    # value    The reboot setting, 1 for enabling and 0 for disabling.
+
+    # This is to cater to boot call points and plugin script which will always
+    # send using value 0 or 1. This dictionary maps to redfish string values.
+    ${rest_redfish_dict}=  Create Dictionary
+    ...                    1=RetryAttempts
+    ...                    0=Disabled
+
+    Run Keyword If  ${REDFISH_REST_SUPPORTED} == ${TRUE}
+    ...    Set Auto Reboot  ${value}
+    ...  ELSE
+    ...    Redfish Set Auto Reboot  ${rest_redfish_dict["${value}"]}
+
+
 Set Auto Reboot
     [Documentation]  Set the given auto reboot setting.
     [Arguments]  ${setting}