Fix usage of subnet_id key for router
At the moment `subnet` is an alias of `subnet_id`. The way, how aliases work in ansible modules, is that ansible does add intended key to param in case alias is used. When riginal key is used, aliases are not populated. Right now in case user define `subnet_id` instead of its alias `subnet` module will fail with KeyError. Change-Id: I5ce547352097ea821be4c9bbc18147575986c740
This commit is contained in:
parent
8612171af3
commit
9b47cb4b59
@ -384,7 +384,7 @@
|
||||
- shade_subnet1
|
||||
network: "{{ external_network_name }}"
|
||||
external_fixed_ips:
|
||||
- subnet: shade_subnet5
|
||||
- subnet_id: shade_subnet5
|
||||
ip: 10.6.6.100
|
||||
|
||||
- name: Gather routers info
|
||||
@ -412,7 +412,7 @@
|
||||
external_gateway_info:
|
||||
network: "{{ external_network_name }}"
|
||||
external_fixed_ips:
|
||||
- subnet: shade_subnet5
|
||||
- subnet_id: shade_subnet5
|
||||
ip: 10.6.6.100
|
||||
- subnet: shade_subnet5
|
||||
ip: 10.6.6.101
|
||||
@ -426,7 +426,7 @@
|
||||
- shade_subnet1
|
||||
network: "{{ external_network_name }}"
|
||||
external_fixed_ips:
|
||||
- subnet: shade_subnet5
|
||||
- subnet_id: shade_subnet5
|
||||
ip: 10.6.6.100
|
||||
- subnet: shade_subnet5
|
||||
ip: 10.6.6.101
|
||||
@ -461,7 +461,7 @@
|
||||
- shade_subnet1
|
||||
network: "{{ external_network_name }}"
|
||||
external_fixed_ips:
|
||||
- subnet: shade_subnet5
|
||||
- subnet_id: shade_subnet5
|
||||
ip: 10.6.6.101
|
||||
|
||||
- name: Update router (remove external fixed ips) again
|
||||
@ -473,7 +473,7 @@
|
||||
- shade_subnet1
|
||||
network: "{{ external_network_name }}"
|
||||
external_fixed_ips:
|
||||
- subnet: shade_subnet5
|
||||
- subnet_id: shade_subnet5
|
||||
ip: 10.6.6.101
|
||||
register: router
|
||||
|
||||
@ -506,7 +506,7 @@
|
||||
- shade_subnet1
|
||||
network: "{{ external_network_name }}"
|
||||
external_fixed_ips:
|
||||
- subnet: shade_subnet5
|
||||
- subnet_id: shade_subnet5
|
||||
ip: 10.6.6.101
|
||||
|
||||
- name: Gather routers info
|
||||
@ -533,7 +533,7 @@
|
||||
- shade_subnet1
|
||||
network: "{{ external_network_name }}"
|
||||
external_fixed_ips:
|
||||
- subnet: shade_subnet5
|
||||
- subnet_id: shade_subnet5
|
||||
ip: 10.6.6.101
|
||||
register: router
|
||||
|
||||
|
@ -461,7 +461,7 @@ class RouterModule(OpenStackModule):
|
||||
if ext_fixed_ips:
|
||||
for iface in ext_fixed_ips:
|
||||
subnet = self.conn.network.find_subnet(
|
||||
iface['subnet'], ignore_missing=False, **filters)
|
||||
iface['subnet_id'], ignore_missing=False, **filters)
|
||||
fip = dict(subnet_id=subnet.id)
|
||||
if 'ip_address' in iface:
|
||||
fip['ip_address'] = iface['ip_address']
|
||||
|
Loading…
x
Reference in New Issue
Block a user