From d71fe4c662f87abd08cafc8457d453320e20f3c6 Mon Sep 17 00:00:00 2001 From: Sylvain Afchain Date: Mon, 3 Aug 2015 12:27:01 +0000 Subject: [PATCH] Avoid reading twice the same project This patch avoid an API call by adding the security_groups field. Change-Id: I9571788a5f875dddf7ea495d4837496399371da3 Partial-Bug: #1480901 --- src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py b/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py index 8ad6385072b..aebd01986e7 100644 --- a/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py +++ b/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py @@ -140,7 +140,7 @@ def _ensure_instance_exists(self, instance_id): def _ensure_default_security_group_exists(self, proj_id): proj_id = str(uuid.UUID(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']) vnc_openstack.ensure_default_security_group(self._vnc_lib, proj_obj) #end _ensure_default_security_group_exists