Skip to content

Commit

Permalink
Avoid reading twice the same project
Browse files Browse the repository at this point in the history
This patch avoid an API call by adding
the security_groups field.

Change-Id: I49933c97f4724362878fb8bd8f800e65eb82f4c6
Partial-Bug: #1480901
  • Loading branch information
safchain committed Aug 3, 2015
1 parent 066ca59 commit e7573d1
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -118,7 +118,8 @@ def _ensure_default_security_group_exists(self, proj_id):
return

proj_id = self._project_id_neutron_to_vnc(proj_id)
proj_obj = self._vnc_lib.project_read(id=proj_id)
proj_obj = self._vnc_lib.project_read(id=proj_id,
fields=['security_groups'])
sg_groups = proj_obj.get_security_groups()
for sg_group in sg_groups or []:
if sg_group['to'][-1] == 'default':
Expand Down

0 comments on commit e7573d1

Please sign in to comment.