summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Chapman <woppin@gmail.com>2021-05-05 16:54:18 +1000
committerMichael Johnson <johnsomor@gmail.com>2021-11-19 23:38:28 +0000
commit92c0d3f201207be84f138c35b82b601cef829a26 (patch)
tree6a808e39f9c8f62155922c70cab301c8f377a7ef
parentb967e9f706373f1aad6db882c2295fbbe1fadfc9 (diff)
downloaddesignate-92c0d3f201207be84f138c35b82b601cef829a26.tar.gz
Support filtering on zone import/export list
List operations should add the task_type criterion to the user provided criterion. This patch also fixes the neutron-tempest-plugin-designate-scenario job to use the ussuri version neutron-tempest-plugin-designate-scenario-ussuri. This is required for this patch to merge. Change-Id: I983d930f975c109cce24a9587bba6db563b3f19f Launchpad: 1926058 (cherry picked from commit fb9f0b33d338037365f5c9dae20f4f795b119d13)
-rw-r--r--.zuul.yaml2
-rw-r--r--designate/central/service.py20
2 files changed, 15 insertions, 7 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index 866e7d3e..dc3e4cbc 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -125,7 +125,7 @@
- release-notes-jobs-python3
check:
jobs:
- - neutron-tempest-plugin-designate-scenario
+ - neutron-tempest-plugin-designate-scenario-ussuri
gate:
queue: designate
experimental:
diff --git a/designate/central/service.py b/designate/central/service.py
index 2c0a8403..ce728464 100644
--- a/designate/central/service.py
+++ b/designate/central/service.py
@@ -2816,9 +2816,13 @@ class Service(service.RPCService):
target = {'tenant_id': context.project_id}
policy.check('find_zone_imports', context, target)
- criterion = {
- 'task_type': 'IMPORT'
- }
+ if not criterion:
+ criterion = {
+ 'task_type': 'IMPORT'
+ }
+ else:
+ criterion['task_type'] = 'IMPORT'
+
return self.storage.find_zone_imports(context, criterion, marker,
limit, sort_key, sort_dir)
@@ -2885,9 +2889,13 @@ class Service(service.RPCService):
target = {'tenant_id': context.project_id}
policy.check('find_zone_exports', context, target)
- criterion = {
- 'task_type': 'EXPORT'
- }
+ if not criterion:
+ criterion = {
+ 'task_type': 'EXPORT'
+ }
+ else:
+ criterion['task_type'] = 'EXPORT'
+
return self.storage.find_zone_exports(context, criterion, marker,
limit, sort_key, sort_dir)