Update ClientID to Context
Changes:
- Session response changes update.
Tested:
- Tested from Sandbox.
Change-Id: I52b69fdc295278fbb1b59c95187f2b5e6fd7d781
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/bmc_redfish_utils.robot b/lib/bmc_redfish_utils.robot
index 3bc107c..6c8143e 100644
--- a/lib/bmc_redfish_utils.robot
+++ b/lib/bmc_redfish_utils.robot
@@ -134,22 +134,24 @@
Get Session With Client Id
- [Documentation] Iterate through the active sessions and return sessions populated with client id.
+ [Documentation] Iterate through the active sessions and return sessions
+ ... populated with Context.
[Arguments] ${session_list}
# Description of argument(s):
# session_list Active session list from SessionService.
- # "Oem": {
- # "OpenBMC": {
- # "@odata.type": "#OemSession.v1_0_0.Session",
- # "ClientID": "MYID=Vd57f62*2811504"
- # }
+ # "@odata.type": "#Session.v1_5_0.Session",
+ # "ClientOriginIPAddress": "xx.xx.xx.xx",
+ # "Context": "MYID-01"
${client_id_sessions}= Create List
FOR ${session} IN @{session_list}
${resp}= Redfish.Get ${session} valid_status_codes=[200,404]
- Run Keyword If '${resp.dict["Oem"]["OpenBMC"]["ClientID"]}' != '${EMPTY}'
+ # This prevents dictionary KeyError exception when the Context
+ # attribute is not populated in generic session response.
+ ${context_var}= Get Variable Value ${resp.dict["Context"]} ${EMPTY}
+ Run Keyword If '${context_var}' != '${EMPTY}'
... Append To List ${client_id_sessions} ${session}
END