Retry initialize OpenBMC request

Currently known issue openbmc/openbmc#1367

Resolves openbmc/openbmc-test-automation#526

Change-Id: Ie97887de59bdd8576b56ef338821aed1dce2c6a4
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/rest_client.robot b/lib/rest_client.robot
index ea75063..4fa1bc3 100644
--- a/lib/rest_client.robot
+++ b/lib/rest_client.robot
@@ -108,13 +108,28 @@
     [Return]    ${ret}
 
 Initialize OpenBMC
-    [Arguments]    ${timeout}=20  ${quiet}=${1}
+    [Arguments]  ${timeout}=20  ${quiet}=${1}
 
-    Create Session  openbmc  ${AUTH_URI}  timeout=${timeout}   max_retries=3
+    # Description of argument(s):
+    # timeout  REST login attempt time out.
+    # quiet    Supress console log if set.
+
+    # TODO : Task to revert this changes openbmc/openbmc-test-automation#532
+    # This will retry at 20 second interval.
+    Wait Until Keyword Succeeds  40 sec  20 sec
+    ...  Post Login Request  ${timeout}  ${quiet}
+
+Post Login Request
+    [Arguments]  ${timeout}=20  ${quiet}=${1}
+
+    # Description of argument(s):
+    # timeout  REST login attempt time out.
+    # quiet    Supress console log if set.
+
+    Create Session  openbmc  ${AUTH_URI}  timeout=${timeout}  max_retries=3
     ${headers}=  Create Dictionary  Content-Type=application/json
     @{credentials}=  Create List  ${OPENBMC_USERNAME}  ${OPENBMC_PASSWORD}
     ${data}=  create dictionary   data=@{credentials}
-
     ${status}  ${resp}=  Run Keyword And Ignore Error  Post Request  openbmc
     ...  /login  data=${data}  headers=${headers}