Add DELETE_ERRLOGS check in code update

by default, all error logs on the system are deleted
skip if set to 0.

Usage:
-v DELETE_ERRLOGS: 0
Change-Id: I68344132ac6fdd99f39146e783b7515734dc6ceb

Signed-off-by: George Keishing <gkeishin@in.ibm.com>
Change-Id: I987e914f380cf250ab067bd751b2d00ae2cb90e1
diff --git a/redfish/extended/redfish_bmc_code_update.robot b/redfish/extended/redfish_bmc_code_update.robot
index 3240db1..5e9f227 100644
--- a/redfish/extended/redfish_bmc_code_update.robot
+++ b/redfish/extended/redfish_bmc_code_update.robot
@@ -34,7 +34,8 @@
 *** Variables ***
 
 ${FORCE_UPDATE}          ${0}
-${LOOP_COUNT}            20
+${LOOP_COUNT}            ${20}
+${DELETE_ERRLOGS}        ${1}
 
 ${ACTIVATION_WAIT_TIMEOUT}     8 min
 
@@ -90,7 +91,8 @@
     Redfish.Login
     # Delete BMC dump and Error logs.
     Run Keyword And Ignore Error  Redfish Delete All BMC Dumps
-    Run Keyword And Ignore Error  Redfish Purge Event Log
+    Run Keyword If  ${DELETE_ERRLOGS} == ${1}
+    ...   Run Keyword And Ignore Error  Redfish Purge Event Log
     # Checking for file existence.
     Valid File Path  IMAGE_FILE_PATH