diff options
author | jf9860 <jf9860@att.com> | 2017-03-09 15:28:42 -0500 |
---|---|---|
committer | jf9860 <jf9860@att.com> | 2017-03-09 15:29:18 -0500 |
commit | 99c6329d9b5f5f83a38eb309181200b80d153949 (patch) | |
tree | b7e51225ba0ac869f4c63d0d456b6bdd90550b6d /robot/resources/openstack/keystone_interface.robot | |
parent | ca5693c162ed0d019b416b5784c0ee8eaf653abf (diff) |
TEST-4 Re-factor openstack region variable
Change-Id: Iad9ef0555dbbd921e261bfa2a63806100bcf7c83
Signed-off-by: jf9860 <jf9860@att.com>
Diffstat (limited to 'robot/resources/openstack/keystone_interface.robot')
-rw-r--r-- | robot/resources/openstack/keystone_interface.robot | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/robot/resources/openstack/keystone_interface.robot b/robot/resources/openstack/keystone_interface.robot index 928efbdd..6c48e120 100644 --- a/robot/resources/openstack/keystone_interface.robot +++ b/robot/resources/openstack/keystone_interface.robot @@ -2,7 +2,8 @@ Documentation The main interface for interacting with Openstack Keystone API. It handles low level stuff like managing the authtoken and Openstack required fields Library OpenstackLibrary Library RequestsLibrary -Library UUID +Library UUID +Library Collections Library OperatingSystem Resource ../global_properties.robot Resource ../json_templater.robot @@ -28,22 +29,27 @@ Run Openstack Auth Request ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Log Sending authenticate post request ${data_path} with headers ${headers} and data ${data} ${resp}= Post Request keystone ${data_path} data=${data} headers=${headers} - Save Openstack Auth ${alias} ${resp.text} + Save Openstack Auth ${alias} ${resp.text} Log Received response from keystone ${resp.text} - + Get Openstack Tenants [Documentation] Returns all the openstack tenant info [Arguments] ${alias} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE} region= url_ext=${OPENSTACK_KEYSTONE_TENANT_PATH} data_path= + ${resp}= Internal Get Openstack With Region ${alias} ${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE} region= url_ext=${OPENSTACK_KEYSTONE_TENANT_PATH} data_path= [Return] ${resp.json()} - + Get Openstack Tenant [Documentation] Returns the openstack tenant info for the specified tenantid [Arguments] ${alias} ${tenant_id} - ${resp}= Internal Get Openstack ${alias} ${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE} region= url_ext=${OPENSTACK_KEYSTONE_TENANT_PATH} data_path=/${tenant_id} + ${resp}= Internal Get Openstack With Region ${alias} ${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE} region= url_ext=${OPENSTACK_KEYSTONE_TENANT_PATH} data_path=/${tenant_id} [Return] ${resp.json()} - + Set Openstack Credentials [Arguments] ${username} ${password} - Return From Keyword If '${username}' != '' ${username} ${password} + Return From Keyword If '${username}' != '' ${username} ${password} + ${user} ${pass}= Get Openstack Credentials + [Return] ${user} ${pass} + +Get Openstack Credentials + Dictionary Should Contain Key ${GLOBAL_VM_PROPERTIES} openstack_username [Return] ${GLOBAL_VM_PROPERTIES['openstack_username']} ${GLOBAL_VM_PROPERTIES['openstack_password']}
\ No newline at end of file |