diff --git a/neutron/extensions/segment.py b/neutron/extensions/segment.py index 0eb19f4f3be..e0eb49358c9 100644 --- a/neutron/extensions/segment.py +++ b/neutron/extensions/segment.py @@ -122,6 +122,10 @@ class Segment(api_extensions.ExtensionDescriptor): controller, attr_map=resource_attributes)] + def update_attributes_map(self, attributes): + super(Segment, self).update_attributes_map( + attributes, extension_attrs_map=RESOURCE_ATTRIBUTE_MAP) + def get_extended_resources(self, version): if version == "2.0": return RESOURCE_ATTRIBUTE_MAP diff --git a/neutron/services/segments/db.py b/neutron/services/segments/db.py index a2ff5bc8748..2eed58da287 100644 --- a/neutron/services/segments/db.py +++ b/neutron/services/segments/db.py @@ -25,6 +25,7 @@ from oslo_db import exception as db_exc from oslo_log import helpers as log_helpers from oslo_utils import uuidutils +from neutron.db import _resource_extend as resource_extend from neutron.db import _utils as db_utils from neutron.db import api as db_api from neutron.db import common_db_mixin @@ -50,6 +51,7 @@ class SegmentDbMixin(common_db_mixin.CommonDbMixin): db.SEGMENTATION_ID: segment_obj[db.SEGMENTATION_ID], 'hosts': segment_obj['hosts'], 'segment_index': segment_obj['segment_index']} + resource_extend.apply_funcs('segments', res, segment_obj.db_obj) return db_utils.resource_fields(res, fields) def _get_segment(self, context, segment_id): diff --git a/releasenotes/notes/add-standard-attributes-to-segment-d39c4b89988aa701.yaml b/releasenotes/notes/add-standard-attributes-to-segment-d39c4b89988aa701.yaml new file mode 100644 index 00000000000..ebab2136a98 --- /dev/null +++ b/releasenotes/notes/add-standard-attributes-to-segment-d39c4b89988aa701.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fix an issue that standard attributes, such as ``created_at``, + ``updated_at`` and ``revision_number``, are not rendered in the response + of segment resource.