Merge "NSX|V: Validate availability zones dvs-ids"

This commit is contained in:
Jenkins 2017-06-04 11:49:18 +00:00 committed by Gerrit Code Review
commit 3f7f2578c6
2 changed files with 7 additions and 0 deletions

View File

@ -250,3 +250,6 @@ class NsxVAvailabilityZones(common_az.ConfiguredAvailabilityZones):
def get_additional_datacenter(self):
return self.get_unique_non_default_param("datacenter_moid")
def get_additional_dvs_ids(self):
return self.get_unique_non_default_param("dvs_id")

View File

@ -4219,6 +4219,10 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
raise nsx_exc.NsxResourceNotFound(
res_name='dvs_id',
res_id=cfg.CONF.nsxv.dvs_id)
for dvs_id in self._availability_zones_data.get_additional_dvs_ids():
if not self.nsx_v.vcns.validate_dvs(dvs_id):
raise nsx_exc.NsxAZResourceNotFound(
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(