From ca45ffecb8532dccb0276fe1a6c1738f877ed1de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89douard=20Thuleau?= Date: Thu, 26 May 2016 14:33:39 +0200 Subject: [PATCH] [VNC OpenStack] List VMI with device_id filters The patch [1] introduced a regression. The VNC API should returns all resources that match ANY given anchors. [1] https://review.opencontrail.org/#/c/19153/ Change-Id: I1363eaa5f89b4df3875f2ac46de40ebc54836ba7 Closes-Bug: #1586012 --- src/config/common/vnc_cassandra.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/config/common/vnc_cassandra.py b/src/config/common/vnc_cassandra.py index 7da6a845d29..a5706819982 100644 --- a/src/config/common/vnc_cassandra.py +++ b/src/config/common/vnc_cassandra.py @@ -890,8 +890,6 @@ def get_fq_name_uuid_list(obj_uuids): start='children:%s:' % (obj_type), finish='children:%s;' % (obj_type), timestamp=True) - if not obj_rows: - return ((True, 0) if count else (True, [])) def filter_rows_parent_anchor(sort=False): # flatten to [('children::', (,), *] @@ -918,7 +916,7 @@ def filter_rows_parent_anchor(sort=False): return get_fq_name_uuid_list(r['uuid'] for r in ret_child_infos) # end filter_rows_parent_anchor - children_fq_names_uuids = filter_rows_parent_anchor(sort=True) + children_fq_names_uuids.extend(filter_rows_parent_anchor(sort=True)) if back_ref_uuids: # go from anchor to backrefs @@ -931,8 +929,6 @@ def filter_rows_parent_anchor(sort=False): start='backref:%s:' % (obj_type), finish='backref:%s;' % (obj_type), timestamp=True) - if not obj_rows: - return ((True, 0) if count else (True, [])) def filter_rows_backref_anchor(): # flatten to [('backref::', (,), *] @@ -953,7 +949,7 @@ def filter_rows_backref_anchor(): filt_backref_infos.values()) # end filter_rows_backref_anchor - children_fq_names_uuids = filter_rows_backref_anchor() + children_fq_names_uuids.extend(filter_rows_backref_anchor()) if not parent_uuids and not back_ref_uuids: obj_uuid_cf = self._obj_uuid_cf @@ -968,7 +964,7 @@ def filter_rows_object_list(): return get_fq_name_uuid_list(filt_obj_infos.keys()) # end filter_rows_object_list - children_fq_names_uuids = filter_rows_object_list() + children_fq_names_uuids.extend(filter_rows_object_list()) else: # grab all resources of this type obj_fq_name_cf = self._obj_fq_name_cf @@ -987,7 +983,7 @@ def filter_rows_no_anchor(): return filt_obj_infos.values() # end filter_rows_no_anchor - children_fq_names_uuids = filter_rows_no_anchor() + children_fq_names_uuids.extend(filter_rows_no_anchor()) if count: return (True, len(children_fq_names_uuids))