Use Agent OVO in agents_db and test_agents_db
Agent object has been merged [1]. This patch uses Agent object in agents_db and test_agents_db. We also introduce a new function (get_agents_object) and keep the old function (get_agents_db) for backward compatibility. [1] https://review.openstack.org/#/c/297887/ Co-Authored-By: Nguyen Phuong An <AnNP@vn.fujitsu.com> Change-Id: I4c4283cb1aa05d52dca00cc249e094ea7d55b1d3 Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
This commit is contained in:
@@ -37,9 +37,8 @@ def count(context, model, **kwargs):
|
||||
|
||||
|
||||
def _kwargs_to_filters(**kwargs):
|
||||
return {k: v if (isinstance(v, list) or
|
||||
isinstance(v, obj_utils.StringMatchingFilterObj))
|
||||
else [v]
|
||||
retain_classes = (list, set, obj_utils.StringMatchingFilterObj)
|
||||
return {k: v if isinstance(v, retain_classes) else [v]
|
||||
for k, v in kwargs.items()}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user