Ensure pools recovery creates the right pool key.
This patch reorganizes the security groups retrieved from Neutron,
which does not always returns them in proper order causing differents 'pool_key'
to be created. Since the 'pool_key' is composed by host address, project id
and security groups.
Closes-Bug:
@@ -553,7 +553,8 @@ class NestedVIFPool(BaseVIFPool):
kuryr_subport = available_subports.get(subport['port_id'])
if kuryr_subport:
pool_key = (host_addr, kuryr_subport['project_id'],
- tuple(kuryr_subport['security_groups']))
+ tuple(sorted(kuryr_subport['security_groups']))
+ )
if action == 'recover':
subnet_id = kuryr_subport['fixed_ips'][0]['subnet_id']
