"security_group_rules" is not a SG selectable field
When building the security group dictionary, it is not needed to
build the security group rules objects individually. These objects
(OVO) are built along with the security group OVO and added in
the result dictionary in ``_make_security_group_dict``.
Related-Bug: #2083682
Change-Id: I66fbf8487b390f7685ef0a4e44c3f58b79cab05f
(cherry picked from commit 232d1d26ea
)
This commit is contained in:
parent
aa2020bc65
commit
32ef705e5b
@ -199,12 +199,6 @@ class SecurityGroupDbMixin(
|
|||||||
with db_api.CONTEXT_READER.using(context):
|
with db_api.CONTEXT_READER.using(context):
|
||||||
sg = self._get_security_group(context, id, fields=fields)
|
sg = self._get_security_group(context, id, fields=fields)
|
||||||
ret = self._make_security_group_dict(context, sg, fields)
|
ret = self._make_security_group_dict(context, sg, fields)
|
||||||
if (fields is None or len(fields) == 0 or
|
|
||||||
'security_group_rules' in fields):
|
|
||||||
rules = self.get_security_group_rules(
|
|
||||||
context_lib.get_admin_context(),
|
|
||||||
{'security_group_id': [id]})
|
|
||||||
ret['security_group_rules'] = rules
|
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
if tenant_id:
|
if tenant_id:
|
||||||
|
Loading…
Reference in New Issue
Block a user