aboutsummaryrefslogtreecommitdiffstats
path: root/robot/resources/openstack
diff options
context:
space:
mode:
authorAndreas Geissler <andreas-geissler@telekom.de>2024-11-05 18:22:30 +0100
committerAndreas Geissler <andreas-geissler@telekom.de>2024-11-08 11:42:55 +0100
commit69fd079507e6a4500c2117b7dad31fa81b7e1299 (patch)
treea55826ede16537d8087c122ec38b00028aa18479 /robot/resources/openstack
parentb3cf372e63b153b19ec685782300ec2bd07875ac (diff)
Update deprecated :FOR loopsHEADmaster
Update SDNC APIs Issue-ID: OOM-3301 Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de> Change-Id: I515e503abef90f3aaa3733d7518d6e738173100e
Diffstat (limited to 'robot/resources/openstack')
-rw-r--r--robot/resources/openstack/keystone_interface.robot7
-rw-r--r--robot/resources/openstack/neutron_interface.robot23
-rw-r--r--robot/resources/openstack/nova_interface.robot9
3 files changed, 22 insertions, 17 deletions
diff --git a/robot/resources/openstack/keystone_interface.robot b/robot/resources/openstack/keystone_interface.robot
index 7dd094bf..487d8aff 100644
--- a/robot/resources/openstack/keystone_interface.robot
+++ b/robot/resources/openstack/keystone_interface.robot
@@ -54,9 +54,10 @@ Get KeystoneAPIVersion
Should Be Equal As Strings ${resp.status_code} 300
${versions}= Get From Dictionary ${resp.json()} versions
${values}= Get From Dictionary ${versions} values
- :FOR ${value} IN @{values}
- \ ${status}= Get Variable Value ${value["status"]}
- \ Run Keyword If '${status}'=='stable' Exit For Loop
+ FOR ${value} IN @{values}
+ ${status}= Get Variable Value ${value["status"]}
+ Run Keyword If '${status}'=='stable' Exit For Loop
+ END
${href}= Set Variable ${value["links"][0]["href"]}
${keystone}= Set Variable ${GLOBAL_INJECTED_KEYSTONE}
${version}= Remove String ${href} ${keystone} /
diff --git a/robot/resources/openstack/neutron_interface.robot b/robot/resources/openstack/neutron_interface.robot
index b216a4d5..74ca5724 100644
--- a/robot/resources/openstack/neutron_interface.robot
+++ b/robot/resources/openstack/neutron_interface.robot
@@ -86,20 +86,22 @@ Get Openstack Subnet By Name
${resp}= Get Openstack Subnets ${alias}
@{list}= Get From Dictionary ${resp} subnets
${returnnet}= Set Variable
- :FOR ${net} IN @{list}
- \ ${name}= Get From Dictionary ${net} name
- \ ${cidr}= Get From Dictionary ${net} cidr
- \ ${returnnet}= Set Variable ${net}
- \ Exit For Loop If '${name}'=='${network_name}' and '${cidr}'=='${network_cidr}'
- \ ${returnnet}= Create DIctionary
+ FOR ${net} IN @{list}
+ ${name}= Get From Dictionary ${net} name
+ ${cidr}= Get From Dictionary ${net} cidr
+ ${returnnet}= Set Variable ${net}
+ Exit For Loop If '${name}'=='${network_name}' and '${cidr}'=='${network_cidr}'
+ ${returnnet}= Create DIctionary
+ END
[Return] ${returnnet}
Get Openstack IP By Name
[Arguments] ${alias} ${network_name} ${cidr} ${ip}
${ports}= Get Openstack Ports For Subnet ${alias} ${network_name} ${cidr}
Log ${ports}
- :FOR ${port} IN @{ports}
- \ Return From Keyword If '${port['fixed_ips'][0]['ip_address']}' == '${ip}' ${port}
+ FOR ${port} IN @{ports}
+ Return From Keyword If '${port['fixed_ips'][0]['ip_address']}' == '${ip}' ${port}
+ END
[Return] None
Get Openstack Ports For Subnet
@@ -107,8 +109,9 @@ Get Openstack Ports For Subnet
${net}= Get Openstack Subnet By Name ${alias} ${network_name} ${cidr}
${ports}= Get Openstack Ports ${alias}
${net_ports}= Create List
- :FOR ${port} IN @{ports['ports']}
- \ Run Keyword If '${net['network_id']}' == '${port['network_id']}' Append To List ${net_ports} ${port}
+ FOR ${port} IN @{ports['ports']}
+ Run Keyword If '${net['network_id']}' == '${port['network_id']}' Append To List ${net_ports} ${port}
+ END
[Return] ${net_ports}
Get Openstack Port By Id
diff --git a/robot/resources/openstack/nova_interface.robot b/robot/resources/openstack/nova_interface.robot
index 55b3467e..b7002d32 100644
--- a/robot/resources/openstack/nova_interface.robot
+++ b/robot/resources/openstack/nova_interface.robot
@@ -132,8 +132,9 @@ Delete Server
Get Id For Name
[Arguments] ${list} ${name}
- :FOR ${item} IN @{list}
- \ ${id}= Get From Dictionary ${item} id
- \ ${n}= Get From Dictionary ${item} name
- \ Return from Keyword If '${n}' == '${name}' ${id}
+ FOR ${item} IN @{list}
+ ${id}= Get From Dictionary ${item} id
+ ${n}= Get From Dictionary ${item} name
+ Return from Keyword If '${n}' == '${name}' ${id}
+ END
[Return] None