From b0fde1cdb6050e3d5b8066d4f882628a381132ac Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Wed, 30 Aug 2017 10:01:21 +0300 Subject: [PATCH] NSX|v AdminUtil ignore irrelevant orphaned networks If the backend network name does not contain a uuid, it is not a neutron network. Change-Id: Iecfc9e4c627057054eba455e618fc02680b0cff3 --- vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py index b2c37ec5fc..90c6127622 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py @@ -164,7 +164,10 @@ def list_orphaned_networks(resource, event, trigger, **kwargs): for net in backend_networks: moref = net['moref'] backend_name = net['name'] - if backend_name.startswith('edge-') or net['type'] == 'Network': + # Decide if this is a neutron network by its name (which should always + # contain the net-id), and type + if (backend_name.startswith('edge-') or len(backend_name) < 36 + or net['type'] == 'Network'): # This is not a neutron network continue # get the list of neutron networks with this moref