Library robot code with the latest directives

Changes: Run Keyword If is deprecated since Robot
Framework version 5.*, use 'IF' instead

Tested: Tested with dry-run option changes

Change-Id: I6a7be9749d00aec3dfdb6b8ae3cf0c4b9ac2ce45
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/snmp/redfish_snmp_utils.robot b/lib/snmp/redfish_snmp_utils.robot
index 9045143..a7bc30a 100644
--- a/lib/snmp/redfish_snmp_utils.robot
+++ b/lib/snmp/redfish_snmp_utils.robot
@@ -175,10 +175,11 @@
 
       # Delete the SNMP manager if the requested IP & ports are found
       # and mark is_snmp_found to true.
-      Run Keyword If  'snmp://${snmp_ip_port}' == '${snmp_mgr}'
-      ...  Run Keywords  Set Local Variable  ${is_snmp_found}  ${True}
-      ...  AND  Redfish.Delete  ${snmp_mgr_uri}
-      ...  AND  Exit For Loop
+      IF  'snmp://${snmp_ip_port}' == '${snmp_mgr}'
+          Set Local Variable  ${is_snmp_found}  ${True}
+          Redfish.Delete  ${snmp_mgr_uri}
+          Exit For Loop
+      END
     END
 
     Pass Execution If  ${is_snmp_found} == ${False}
diff --git a/lib/snmp/snmp_utils.robot b/lib/snmp/snmp_utils.robot
index d94cb8f..122789b 100644
--- a/lib/snmp/snmp_utils.robot
+++ b/lib/snmp/snmp_utils.robot
@@ -34,13 +34,13 @@
     ${resp}=  OpenBMC Post Request
     ...  ${SNMP_MANAGER_URI}action/Client  data=${data}
 
-    Run Keyword If  '${expected_result}' == 'error'
-    ...      Should Be Equal As Strings
-    ...      ${resp.status_code}  ${HTTP_BAD_REQUEST}
-    ...      msg=Allowing the configuration of an invalid SNMP.
-    ...  ELSE
-    ...      Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
-    ...      msg=Not allowing the configuration of a valid SNMP.
+    IF  '${expected_result}' == 'error'
+        Should Be Equal As Strings  ${resp.status_code}  ${HTTP_BAD_REQUEST}
+        ...  msg=Allowing the configuration of an invalid SNMP.
+    ELSE
+        Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
+        ...  msg=Not allowing the configuration of a valid SNMP.
+    END
 
 
 Get List Of SNMP Manager And Port Configured On BMC
@@ -95,9 +95,9 @@
     ${snmp_objs}=  Read Properties  ${SNMP_MANAGER_URI}enumerate
     FOR  ${snmp_obj}  IN   @{snmp_objs}
         ${obj}=  Set Variable  ${snmp_objs['${snmp_obj}']}
-        Run Keyword If
-        ...  '${obj['Address']}' == '${ip}' and '${obj['Port']}' == '${port}'
-        ...    Return From Keyword  ${snmp_obj}
+        IF  '${obj['Address']}' == '${ip}' and '${obj['Port']}' == '${port}'
+            Return From Keyword  ${snmp_obj}
+        END
     END
 
     Return From Keyword  ${EMPTY}