Redfish new code update URI changes

Changes:
     - Add the new FW update URI based on the probe if it
       exists. This ensures the current and
       new URI co-exist for older and newer drivers.
     - Old : /redfish/v1/UpdateService and
       New : /redfish/v1/UpdateService/update

Tested:
     - Suite redfish_bmc_code_update.robot tested in sandbox
       and there are other places which will need changes.
       This commit will ONLY add for HW Jenkinsins to
       ensure the upstream HW CI pipeline is not broken.

Change-Id: I9c3f780a03d73615a285fa6682728d607e734340
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/redfish/extended/redfish_bmc_code_update.robot b/redfish/extended/redfish_bmc_code_update.robot
index 1d4fb9e..467d2e8 100644
--- a/redfish/extended/redfish_bmc_code_update.robot
+++ b/redfish/extended/redfish_bmc_code_update.robot
@@ -39,6 +39,9 @@
 
 ${ACTIVATION_WAIT_TIMEOUT}     8 min
 
+# New code update path.
+${REDFISH_UPDATE_URI}    /redfish/v1/UpdateService/update
+
 *** Test Cases ***
 
 Redfish BMC Code Update
@@ -123,6 +126,18 @@
     # Checking for file existence.
     Valid File Path  IMAGE_FILE_PATH
 
+    # Check and set the update path.
+    # Old - /redfish/v1/UpdateService/
+    # New - /redfish/v1/UpdateService/update
+    ${resp}=  Redfish.Get  /redfish/v1/UpdateService/update
+    ...  valid_status_codes=[${HTTP_OK},${HTTP_NOT_FOUND},${HTTP_METHOD_NOT_ALLOWED}]
+
+    # If the method is not found, set update URI to old method.
+    Run Keyword If  ${resp.status} == ${HTTP_NOT_FOUND}
+    ...  Set Suite Variable  ${REDFISH_UPDATE_URI}  /redfish/v1/UpdateService
+
+    Log To Console  Update URI: ${REDFISH_UPDATE_URI}
+
     Redfish Power Off  stack_mode=skip
 
 
@@ -256,7 +271,7 @@
     Log To Console   Current images on the BMC before upload: ${before_inv_list}
 
     Print Timen  Start uploading image to BMC.
-    Redfish Upload Image  /redfish/v1/UpdateService  ${IMAGE_FILE_PATH}
+    Redfish Upload Image  ${REDFISH_UPDATE_URI}  ${IMAGE_FILE_PATH}
     Print Timen  Completed image upload to BMC.
 
     # Python module:  get_member_list(resource_path)