aboutsummaryrefslogtreecommitdiffstats
path: root/robot/resources/openstack/keystone_interface.robot
diff options
context:
space:
mode:
Diffstat (limited to 'robot/resources/openstack/keystone_interface.robot')
-rw-r--r--robot/resources/openstack/keystone_interface.robot22
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