diff options
author | Dmitriy Rabotyagov <dmitriy.rabotyagov@citynetwork.eu> | 2021-04-13 16:31:33 +0300 |
---|---|---|
committer | Dmitriy Rabotyagov <noonedeadpunk@ya.ru> | 2021-04-14 13:28:11 +0000 |
commit | 003b98a73e5da99eadcc1806f3e0cc9a109ea1cb (patch) | |
tree | 5f83003c9d7ebe1b7fc0d2b7f97f79f453a8fd5c | |
parent | 368915a29d8bfe89861ffd3c1b7bb1f3b899416f (diff) | |
download | trove-003b98a73e5da99eadcc1806f3e0cc9a109ea1cb.tar.gz |
Fix check_subnet_router filters
Device owner of router ports is not limited to network:router_interface
and can also be network:router_interface_distributed or
network:ha_router_replicated_interface depending on the router
to which port is attached.
Currently, when HA router is used, trove fails with:
`Subnet is not associated with router` since port does not pass filter
Change-Id: Ie8b3884dd13147f29d5632275fa5c75e801e04c8
(cherry picked from commit d5497179d4789ef1c22ad8f9a39c719459241a62)
-rw-r--r-- | trove/common/neutron.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/trove/common/neutron.py b/trove/common/neutron.py index 1c11dcb1..9f82eb16 100644 --- a/trove/common/neutron.py +++ b/trove/common/neutron.py @@ -81,6 +81,12 @@ def check_subnet_router(client, subnet_id): """Check if the subnet is associated with a router.""" router_ports = client.list_ports( device_owner="network:router_interface", + fixed_ips=f"subnet_id={subnet_id}" + )["ports"] + client.list_ports( + device_owner="network:router_interface_distributed", + fixed_ips=f"subnet_id={subnet_id}" + )["ports"] + client.list_ports( + device_owner="network:ha_router_replicated_interface", fixed_ips=f"subnet_id={subnet_id}")["ports"] if not router_ports: raise exception.TroveError(f"Subnet {subnet_id} is not " |