summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-03-26 14:45:40 +0000
committerGerrit Code Review <review@openstack.org>2015-03-26 14:45:40 +0000
commitc4729e8805acdf8a99cd18aab44857c775e1312c (patch)
treee4d9b95c6c39f696a94f08a368fe6e815279fc6c
parentd199ac014725054c2875ab7d01f5dbd4ba6d2b62 (diff)
parent4cfc52dfea23580711eefcbcd1737fd651576be7 (diff)
downloadneutron-pecan.tar.gz
Merge "Remove allow_overlap from subnetpools API"neutron-pecan
-rw-r--r--neutron/api/v2/attributes.py5
-rw-r--r--neutron/db/db_base_plugin_v2.py7
-rw-r--r--neutron/db/migration/alembic_migrations/versions/034883111f_remove_subnetpool_allow_overlap.py28
-rw-r--r--neutron/db/migration/alembic_migrations/versions/HEAD2
-rw-r--r--neutron/db/models_v2.py1
-rw-r--r--neutron/ipam/subnet_alloc.py3
6 files changed, 32 insertions, 14 deletions
diff --git a/neutron/api/v2/attributes.py b/neutron/api/v2/attributes.py
index 4f927ea7c7..146b5013e4 100644
--- a/neutron/api/v2/attributes.py
+++ b/neutron/api/v2/attributes.py
@@ -837,11 +837,6 @@ RESOURCE_ATTRIBUTE_MAP = {
'ip_version': {'allow_post': False,
'allow_put': False,
'is_visible': True},
- 'allow_overlap': {'allow_post': True,
- 'allow_put': False,
- 'default': False,
- 'convert_to': convert_to_boolean,
- 'is_visible': True},
'default_prefixlen': {'allow_post': True,
'allow_put': True,
'validate': {'type:non_negative': None},
diff --git a/neutron/db/db_base_plugin_v2.py b/neutron/db/db_base_plugin_v2.py
index 5866326414..73d7f45cb7 100644
--- a/neutron/db/db_base_plugin_v2.py
+++ b/neutron/db/db_base_plugin_v2.py
@@ -868,7 +868,6 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2,
'min_prefixlen': min_prefixlen,
'max_prefixlen': max_prefixlen,
'shared': subnetpool['shared'],
- 'allow_overlap': subnetpool['allow_overlap'],
'prefixes': [prefix['cidr']
for prefix in subnetpool['prefixes']],
'ip_version': subnetpool['ip_version']}
@@ -1373,8 +1372,7 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2,
sp_reader.default_prefixlen,
'min_prefixlen': sp_reader.min_prefixlen,
'max_prefixlen': sp_reader.max_prefixlen,
- 'shared': sp_reader.shared,
- 'allow_overlap': sp_reader.allow_overlap}
+ 'shared': sp_reader.shared}
subnetpool = models_v2.SubnetPool(**pool_args)
context.session.add(subnetpool)
for prefix in sp_reader.prefixes:
@@ -1410,8 +1408,7 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2,
updated['prefixes'] = orig_prefixes
for key in ['id', 'name', 'ip_version', 'min_prefixlen',
- 'max_prefixlen', 'default_prefixlen', 'allow_overlap',
- 'shared']:
+ 'max_prefixlen', 'default_prefixlen', 'shared']:
self._write_key(key, updated, model, new_pool)
return updated
diff --git a/neutron/db/migration/alembic_migrations/versions/034883111f_remove_subnetpool_allow_overlap.py b/neutron/db/migration/alembic_migrations/versions/034883111f_remove_subnetpool_allow_overlap.py
new file mode 100644
index 0000000000..ab59122e7a
--- /dev/null
+++ b/neutron/db/migration/alembic_migrations/versions/034883111f_remove_subnetpool_allow_overlap.py
@@ -0,0 +1,28 @@
+# Copyright 2014 OpenStack Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+"""Remove allow_overlap from subnetpools
+"""
+
+# revision identifiers, used by Alembic.
+revision = '034883111f'
+down_revision = '20b99fd19d4f'
+
+
+from alembic import op
+
+
+def upgrade():
+ op.drop_column('subnetpools', 'allow_overlap')
diff --git a/neutron/db/migration/alembic_migrations/versions/HEAD b/neutron/db/migration/alembic_migrations/versions/HEAD
index 0dd06323d9..1761684630 100644
--- a/neutron/db/migration/alembic_migrations/versions/HEAD
+++ b/neutron/db/migration/alembic_migrations/versions/HEAD
@@ -1 +1 @@
-20b99fd19d4f
+034883111f
diff --git a/neutron/db/models_v2.py b/neutron/db/models_v2.py
index 48e8296960..9218587bf2 100644
--- a/neutron/db/models_v2.py
+++ b/neutron/db/models_v2.py
@@ -232,7 +232,6 @@ class SubnetPool(model_base.BASEV2, HasId, HasTenant):
min_prefixlen = sa.Column(sa.Integer, nullable=False)
max_prefixlen = sa.Column(sa.Integer, nullable=False)
shared = sa.Column(sa.Boolean, nullable=False)
- allow_overlap = sa.Column(sa.Boolean, nullable=False)
prefixes = orm.relationship(SubnetPoolPrefix,
backref='subnetpools',
cascade='all, delete, delete-orphan',
diff --git a/neutron/ipam/subnet_alloc.py b/neutron/ipam/subnet_alloc.py
index 72c9af091c..876727dd43 100644
--- a/neutron/ipam/subnet_alloc.py
+++ b/neutron/ipam/subnet_alloc.py
@@ -37,7 +37,7 @@ class SubnetPoolReader(object):
self._read_id(subnetpool)
self._read_prefix_bounds(subnetpool)
self._read_attrs(subnetpool,
- ['tenant_id', 'name', 'allow_overlap', 'shared'])
+ ['tenant_id', 'name', 'shared'])
self.subnetpool = {'id': self.id,
'name': self.name,
'tenant_id': self.tenant_id,
@@ -48,7 +48,6 @@ class SubnetPoolReader(object):
'max_prefixlen': self.max_prefixlen,
'default_prefix': self.default_prefix,
'default_prefixlen': self.default_prefixlen,
- 'allow_overlap': self.allow_overlap,
'shared': self.shared}
def _read_attrs(self, subnetpool, keys):