Merge "Add standard attributes to segment resource"

This commit is contained in:
Zuul 2018-04-17 18:40:48 +00:00 committed by Gerrit Code Review
commit d015e84a6d
3 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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):

View File

@ -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.