Support filtering on zone import/export list
List operations should add the task_type criterion to the user provided criterion. Change-Id: I983d930f975c109cce24a9587bba6db563b3f19f Launchpad: 1926058
This commit is contained in:
parent
40b5633dfd
commit
fb9f0b33d3
|
@ -2817,9 +2817,13 @@ class Service(service.RPCService):
|
||||||
target = {'tenant_id': context.project_id}
|
target = {'tenant_id': context.project_id}
|
||||||
policy.check('find_zone_imports', context, target)
|
policy.check('find_zone_imports', context, target)
|
||||||
|
|
||||||
criterion = {
|
if not criterion:
|
||||||
'task_type': 'IMPORT'
|
criterion = {
|
||||||
}
|
'task_type': 'IMPORT'
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
criterion['task_type'] = 'IMPORT'
|
||||||
|
|
||||||
return self.storage.find_zone_imports(context, criterion, marker,
|
return self.storage.find_zone_imports(context, criterion, marker,
|
||||||
limit, sort_key, sort_dir)
|
limit, sort_key, sort_dir)
|
||||||
|
|
||||||
|
@ -2886,9 +2890,13 @@ class Service(service.RPCService):
|
||||||
target = {'tenant_id': context.project_id}
|
target = {'tenant_id': context.project_id}
|
||||||
policy.check('find_zone_exports', context, target)
|
policy.check('find_zone_exports', context, target)
|
||||||
|
|
||||||
criterion = {
|
if not criterion:
|
||||||
'task_type': 'EXPORT'
|
criterion = {
|
||||||
}
|
'task_type': 'EXPORT'
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
criterion['task_type'] = 'EXPORT'
|
||||||
|
|
||||||
return self.storage.find_zone_exports(context, criterion, marker,
|
return self.storage.find_zone_exports(context, criterion, marker,
|
||||||
limit, sort_key, sort_dir)
|
limit, sort_key, sort_dir)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue