Skip to content

Commit

Permalink
[VNC OpenStack] List VMI with device_id filters
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Édouard Thuleau committed May 26, 2016
1 parent 25c15cf commit ca45ffe
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/config/common/vnc_cassandra.py
Expand Up @@ -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:<type>:<uuid>', (<val>,<ts>), *]
Expand All @@ -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
Expand All @@ -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:<obj-type>:<uuid>', (<val>,<ts>), *]
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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))
Expand Down

0 comments on commit ca45ffe

Please sign in to comment.