Merge "Add neutron address_scope constraint"

This commit is contained in:
Jenkins 2015-12-04 15:27:35 +00:00 committed by Gerrit Code Review
commit b36883f3f8
3 changed files with 14 additions and 0 deletions

View File

@ -75,3 +75,13 @@ class SubnetPoolConstraint(constraints.BaseCustomConstraint):
neutron_client = client.client('neutron')
neutronV20.find_resourceid_by_name_or_id(
neutron_client, 'subnetpool', value)
class AddressScopeConstraint(constraints.BaseCustomConstraint):
expected_exceptions = (exceptions.NeutronClientException,)
def validate_with_client(self, client, value):
neutron_client = client.client('neutron')
neutronV20.find_resourceid_by_name_or_id(
neutron_client, 'address_scope', value)

View File

@ -170,6 +170,9 @@ class NeutronConstraintsValidate(common.HeatTestCase):
('validate_subnetpool',
dict(constraint_class=nc.SubnetPoolConstraint,
resource_type='subnetpool')),
('validate_address_scope',
dict(constraint_class=nc.AddressScopeConstraint,
resource_type='address_scope')),
('validate_loadbalancer',
dict(constraint_class=lc.LoadbalancerConstraint,
resource_type='loadbalancer')),

View File

@ -76,6 +76,7 @@ heat.constraints =
nova.flavor = heat.engine.clients.os.nova:FlavorConstraint
nova.host = heat.engine.clients.os.nova:HostConstraint
nova.network = heat.engine.clients.os.nova:NetworkConstraint
neutron.address_scope = heat.engine.clients.os.neutron.neutron_constraints:AddressScopeConstraint
neutron.network = heat.engine.clients.os.neutron.neutron_constraints:NetworkConstraint
neutron.port = heat.engine.clients.os.neutron.neutron_constraints:PortConstraint
neutron.router = heat.engine.clients.os.neutron.neutron_constraints:RouterConstraint