Browse Source

Ensure security group rule description is returned

The neutron standard-attr-description is not working with NSX
plugins for security group rules. It seems that when the extension
is loaded the relevant DB model class is not yet available.

To address this problem, this change explictly adds a resource
extender function for the NSX plugin to add the description field
to ecurity groups rule responses.

Change-Id: I4d8b2629660f9e33401ce6b011b1784a6ec66aac
changes/54/819454/1
Salvatore Orlando 7 months ago committed by Salvatore Orlando
parent
commit
69a22cb693
  1. 7
      vmware_nsx/db/extended_security_group_rule.py

7
vmware_nsx/db/extended_security_group_rule.py

@ -92,6 +92,13 @@ class ExtendedSecurityGroupRuleMixin(object):
else:
sg_rule_res[ext_local_ip.LOCAL_IP_PREFIX] = None
@staticmethod
@resource_extend.extends([ext_sg.SECURITYGROUPRULES])
def _extend_sg_rule_description(res, db_object):
if not hasattr(db_object, 'description'):
return
res['description'] = db_object.description
def _get_security_group_rule_local_ip(self, context, rule_id):
with db_api.CONTEXT_READER.using(context):
try:

Loading…
Cancel
Save