diff options
author | DR695H <dr695h@att.com> | 2019-06-20 15:04:04 -0400 |
---|---|---|
committer | DR695H <dr695h@att.com> | 2019-06-20 15:04:04 -0400 |
commit | 3bb6cf4b938d3e725860606d3ddaa8eecd872151 (patch) | |
tree | e03ccb5b30413d9fc7b3cef8c5ef0827d2e641d2 /robot/resources/openstack/nova_interface.robot | |
parent | 3440942ef2c78e1a8eb07c70c1a03b3834beaecf (diff) |
replace aai, closeloop, sdc with jinja
Issue-ID: TEST-158
Change-Id: I95a783f26e28512cb4fc98e50931d62001c489c6
Signed-off-by: DR695H <dr695h@att.com>
Diffstat (limited to 'robot/resources/openstack/nova_interface.robot')
-rw-r--r-- | robot/resources/openstack/nova_interface.robot | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/robot/resources/openstack/nova_interface.robot b/robot/resources/openstack/nova_interface.robot index 94a07479..b1f07f86 100644 --- a/robot/resources/openstack/nova_interface.robot +++ b/robot/resources/openstack/nova_interface.robot @@ -3,22 +3,22 @@ Documentation The main interface for interacting with Openstack. It handles Library ONAPLibrary.Openstack Library RequestsLibrary Library ONAPLibrary.JSON +Library ONAPLibrary.Templating Library OperatingSystem Library Collections Resource ../global_properties.robot -Resource ../json_templater.robot Resource openstack_common.robot *** Variables *** ${OPENSTACK_NOVA_API_VERSION} /v2 ${OPENSTACK_NOVA_KEYPAIR_PATH} /os-keypairs -${OPENSTACK_NOVA_KEYPAIR_ADD_BODY_FILE} robot/assets/templates/nova_add_keypair.template +${OPENSTACK_NOVA_KEYPAIR_ADD_BODY_FILE} openstack/nova_add_keypair.jinja ${OPENSTACK_NOVA_KEYPAIR_SSH_KEY} robot/assets/keys/robot_ssh_public_key.txt ${OPENSTACK_NOVA_FLAVORS_PATH} /flavors ${OPENSTACK_NOVA_SERVERS_PATH} /servers ${OPENSTACK_NOVA_IMAGES_PATH} /images ${OPENSTACK_NOVA_SERVERS_REBOOT_BODY} {"reboot" : { "type" : "SOFT" }} -${OPENSTACK_NOVA_SERVER_ADD_BODY_FILE} robot/assets/templates/nova_add_server.template +${OPENSTACK_NOVA_SERVER_ADD_BODY_FILE} openstack/nova_add_server.jinja *** Keywords *** @@ -33,7 +33,8 @@ Add Openstack Keypair [Arguments] ${alias} ${name} ${ssh_key}= OperatingSystem.Get File ${OPENSTACK_NOVA_KEYPAIR_SSH_KEY} ${arguments}= Create Dictionary name=${name} publickey=${ssh_key} - ${data}= Fill JSON Template File ${OPENSTACK_NOVA_KEYPAIR_ADD_BODY_FILE} ${arguments} + Create Environment openstack ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Apply Template openstack ${OPENSTACK_NOVA_KEYPAIR_ADD_BODY_FILE} ${arguments} ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_KEYPAIR_PATH} data_path= data=${data} Should Be Equal As Strings 200 ${resp.status_code} [Return] ${resp.json()['keypair']['name']} @@ -84,7 +85,8 @@ Add Server [Documentation] Adds a server for the passed if [Arguments] ${alias} ${name} ${imageRef} ${flavorRef} ${dict}= Create Dictionary name=${name} imageRef=${imageRef} flavorRef=${flavorRef} - ${data}= Fill JSON Template File ${OPENSTACK_NOVA_SERVER_ADD_BODY_FILE} ${dict} + Create Environment openstack ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Apply Template openstack ${OPENSTACK_NOVA_SERVER_ADD_BODY_FILE} ${dict} ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_SERVERS_PATH} data_path= data=${data} [Return] ${resp} @@ -98,7 +100,8 @@ Add Server For Image Name ${imageRef}= Get Id For Name ${images} ${imageName} ${flavorRef}= Get Id For Name ${flavors} ${flavorName} ${dict}= Create Dictionary name=${name} imageRef=${imageRef} flavorRef=${flavorRef} public_net_id=${public_net_id} - ${data}= Fill JSON Template File ${OPENSTACK_NOVA_SERVER_ADD_BODY_FILE} ${dict} + Create Environment openstack ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Apply Template openstack ${OPENSTACK_NOVA_SERVER_ADD_BODY_FILE} ${dict} ${resp}= Internal Post Openstack ${alias} ${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} ${OPENSTACK_NOVA_SERVERS_PATH} data_path= data=${data} ${status_string}= Convert To String ${resp.status_code} Should Match Regexp ${status_string} ^(202)$ |