Do not rely on description for checking port type

Use port network ID is more reasonable.

Change-Id: I219bf3db15124e67cd65c7d7f686ba73573e2761
This commit is contained in:
Lingxian Kong 2020-12-08 21:58:38 +13:00
parent 9ea87ccf43
commit 9a6d41633c

View File

@ -1392,7 +1392,7 @@ class BuiltInstanceTasks(BuiltInstance, NotifyMixin, ConfigurationMixin):
if is_public != new_is_public: if is_public != new_is_public:
for port in ports: for port in ports:
if 'User port' in port['description']: if port['network_id'] not in CONF.management_networks:
LOG.debug(f"Updating port {port['id']}, is_public: " LOG.debug(f"Updating port {port['id']}, is_public: "
f"{new_is_public}") f"{new_is_public}")
neutron.ensure_port_access(self.neutron_client, port['id'], neutron.ensure_port_access(self.neutron_client, port['id'],