In OpenStack CLI Get List error, RequestsLibrary.To Json
${json} will result in exception if return value of
OpenStack CLI is empty, i.e. ${json} is empty, this will
terminate current keyword/test case, it isn't what we expect.
This commit fixed this error and make sure current keyword/test
case can be run normally.
Change-Id: If36e27f092e66920004cfc09e9a6d6ec88bf5b51
JIRA: INTTEST-56
Signed-off-by: Yi Yang <yangyi01@inspur.com>
OpenStack CLI Get List
[Arguments] ${cmd}
[Documentation] Return a json list from the output of an OpenStack command.
- @{list} = BuiltIn.Create List
${json} = OpenStack CLI ${cmd}
- @{list} = RequestsLibrary.To Json ${json}
+ @{list} = BuiltIn.Run Keyword If ${json} RequestsLibrary.To Json ${json}
+ ... ELSE BuiltIn.Create List
BuiltIn.Log ${list}
[Return] @{list}