summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHongbin Lu <hongbin.lu@huawei.com>2018-04-18 15:41:45 +0000
committerHongbin Lu <hongbin.lu@huawei.com>2018-04-18 19:25:57 +0000
commit9506044550ca0eab31612f0f1228eb30b2150532 (patch)
tree17cb78b9bbdd66ef6cc54faad668676b9560e392
parentf2dced777acb7d87dc7048c3efec59dadf37930d (diff)
Add a shim extension standard-attr-segment
Standard attributes has been added to segment [1] and we need a shim extension to indicate this. [1] https://review.openstack.org/#/c/558318/ Change-Id: I761fa7cb684a457726dedc95fde92d6adb86f5e4 Partial-Bug: #1765008
Notes
Notes (review): Verified+1: Arista CI <arista-openstack-test@aristanetworks.com> Code-Review+2: Ihar Hrachyshka <ihrachys@redhat.com> Code-Review+2: Miguel Lavalle <miguel.lavalle@huawei.com> Workflow+1: Miguel Lavalle <miguel.lavalle@huawei.com> Verified+1: Mellanox CI <mlnx-openstack-ci@dev.mellanox.co.il> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 19 Apr 2018 05:27:35 +0000 Reviewed-on: https://review.openstack.org/562320 Project: openstack/neutron Branch: refs/heads/master
-rw-r--r--neutron/extensions/_standard_attr_segment_lib.py30
-rw-r--r--neutron/extensions/standard_attr_segment.py18
-rw-r--r--neutron/plugins/ml2/plugin.py3
-rw-r--r--neutron/tests/contrib/hooks/api_all_extensions1
4 files changed, 51 insertions, 1 deletions
diff --git a/neutron/extensions/_standard_attr_segment_lib.py b/neutron/extensions/_standard_attr_segment_lib.py
new file mode 100644
index 0000000..f5b5fb7
--- /dev/null
+++ b/neutron/extensions/_standard_attr_segment_lib.py
@@ -0,0 +1,30 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13"""
14TODO(hongbin): This module should be deleted once neutron-lib containing
15https://review.openstack.org/#/c/562331/ change is released.
16"""
17
18
19ALIAS = 'standard-attr-segment'
20IS_SHIM_EXTENSION = True
21IS_STANDARD_ATTR_EXTENSION = True
22NAME = 'Standard Attribute Segment Extension'
23DESCRIPTION = 'Add standard attributes to Segment resource'
24UPDATED_TIMESTAMP = '2018-04-09T10:00:00-00:00'
25RESOURCE_ATTRIBUTE_MAP = {}
26SUB_RESOURCE_ATTRIBUTE_MAP = {}
27ACTION_MAP = {}
28REQUIRED_EXTENSIONS = []
29OPTIONAL_EXTENSIONS = []
30ACTION_STATUS = {}
diff --git a/neutron/extensions/standard_attr_segment.py b/neutron/extensions/standard_attr_segment.py
new file mode 100644
index 0000000..002019b
--- /dev/null
+++ b/neutron/extensions/standard_attr_segment.py
@@ -0,0 +1,18 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from neutron.extensions import _standard_attr_segment_lib as apidef
14from neutron_lib.api import extensions
15
16
17class Standard_attr_segment(extensions.APIExtensionDescriptor):
18 api_definition = apidef
diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py
index 6b100c0..0f576a6 100644
--- a/neutron/plugins/ml2/plugin.py
+++ b/neutron/plugins/ml2/plugin.py
@@ -158,7 +158,8 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
158 "default-subnetpools", 158 "default-subnetpools",
159 "subnet-service-types", 159 "subnet-service-types",
160 "ip-substring-filtering", 160 "ip-substring-filtering",
161 "port-security-groups-filtering"] 161 "port-security-groups-filtering",
162 "standard-attr-segment"]
162 163
163 @property 164 @property
164 def supported_extension_aliases(self): 165 def supported_extension_aliases(self):
diff --git a/neutron/tests/contrib/hooks/api_all_extensions b/neutron/tests/contrib/hooks/api_all_extensions
index 47c19be..f6a7e34 100644
--- a/neutron/tests/contrib/hooks/api_all_extensions
+++ b/neutron/tests/contrib/hooks/api_all_extensions
@@ -43,6 +43,7 @@ NETWORK_API_EXTENSIONS+=",service-type"
43NETWORK_API_EXTENSIONS+=",sorting" 43NETWORK_API_EXTENSIONS+=",sorting"
44NETWORK_API_EXTENSIONS+=",standard-attr-description" 44NETWORK_API_EXTENSIONS+=",standard-attr-description"
45NETWORK_API_EXTENSIONS+=",standard-attr-revisions" 45NETWORK_API_EXTENSIONS+=",standard-attr-revisions"
46NETWORK_API_EXTENSIONS+=",standard-attr-segment"
46NETWORK_API_EXTENSIONS+=",standard-attr-timestamp" 47NETWORK_API_EXTENSIONS+=",standard-attr-timestamp"
47NETWORK_API_EXTENSIONS+=",standard-attr-tag" 48NETWORK_API_EXTENSIONS+=",standard-attr-tag"
48NETWORK_API_EXTENSIONS+=",subnet_allocation" 49NETWORK_API_EXTENSIONS+=",subnet_allocation"