summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 0000000000..f5b5fb7641
--- /dev/null
+++ b/neutron/extensions/_standard_attr_segment_lib.py
@@ -0,0 +1,30 @@
+# 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.
+
+"""
+TODO(hongbin): This module should be deleted once neutron-lib containing
+https://review.openstack.org/#/c/562331/ change is released.
+"""
+
+
+ALIAS = 'standard-attr-segment'
+IS_SHIM_EXTENSION = True
+IS_STANDARD_ATTR_EXTENSION = True
+NAME = 'Standard Attribute Segment Extension'
+DESCRIPTION = 'Add standard attributes to Segment resource'
+UPDATED_TIMESTAMP = '2018-04-09T10:00:00-00:00'
+RESOURCE_ATTRIBUTE_MAP = {}
+SUB_RESOURCE_ATTRIBUTE_MAP = {}
+ACTION_MAP = {}
+REQUIRED_EXTENSIONS = []
+OPTIONAL_EXTENSIONS = []
+ACTION_STATUS = {}
diff --git a/neutron/extensions/standard_attr_segment.py b/neutron/extensions/standard_attr_segment.py
new file mode 100644
index 0000000000..002019b017
--- /dev/null
+++ b/neutron/extensions/standard_attr_segment.py
@@ -0,0 +1,18 @@
+# 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.
+
+from neutron.extensions import _standard_attr_segment_lib as apidef
+from neutron_lib.api import extensions
+
+
+class Standard_attr_segment(extensions.APIExtensionDescriptor):
+ api_definition = apidef
diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py
index bd1953f8b1..94c210f754 100644
--- a/neutron/plugins/ml2/plugin.py
+++ b/neutron/plugins/ml2/plugin.py
@@ -158,7 +158,8 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
"default-subnetpools",
"subnet-service-types",
"ip-substring-filtering",
- "port-security-groups-filtering"]
+ "port-security-groups-filtering",
+ "standard-attr-segment"]
@property
def supported_extension_aliases(self):
diff --git a/neutron/tests/contrib/hooks/api_all_extensions b/neutron/tests/contrib/hooks/api_all_extensions
index d9bca47599..f68d929d23 100644
--- a/neutron/tests/contrib/hooks/api_all_extensions
+++ b/neutron/tests/contrib/hooks/api_all_extensions
@@ -44,6 +44,7 @@ NETWORK_API_EXTENSIONS+=",service-type"
NETWORK_API_EXTENSIONS+=",sorting"
NETWORK_API_EXTENSIONS+=",standard-attr-description"
NETWORK_API_EXTENSIONS+=",standard-attr-revisions"
+NETWORK_API_EXTENSIONS+=",standard-attr-segment"
NETWORK_API_EXTENSIONS+=",standard-attr-timestamp"
NETWORK_API_EXTENSIONS+=",standard-attr-tag"
NETWORK_API_EXTENSIONS+=",subnet_allocation"