From d82344cddf04d67d96ab0e0689be33adbfece72d Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Sat, 25 Nov 2017 23:25:41 -0800 Subject: [PATCH] NSX|V: validate DVS in network-vlan-ranges Ensure that the DVS IDS are validated Change-Id: I5e839185707acd9ce87f47ecb40ee913f7fcc8df --- vmware_nsx/plugins/nsx_v/plugin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index 07a0499787..73c155f125 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -4396,6 +4396,13 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, raise nsx_exc.NsxAZResourceNotFound( res_name='dvs_id', res_id=dvs_id) + # validate network-vlan dvs ID's + for dvs_id in self._network_vlans: + if not self.nsx_v.vcns.validate_dvs(dvs_id, + dvs_list=existing_dvs): + raise nsx_exc.NsxResourceNotFound(res_name='dvs_id', + res_id=dvs_id) + # Validate the global & per-AZ validate_datacenter_moid if not self.nsx_v.vcns.validate_datacenter_moid( cfg.CONF.nsxv.datacenter_moid,