From 675e42f0d2627f9631c7a1aa3c3e38b9c544959c Mon Sep 17 00:00:00 2001 From: Adrian Turjak Date: Thu, 24 Sep 2020 16:16:27 +1200 Subject: [PATCH] Make Distil Health check respect collection domains Without this, when that config is set, the healthcheck will report uncollected projects that aren't being collected anymore. Also fix some testing. Change-Id: Ife60eee1400ec596565188b477d64f68b247fcec --- .zuul.yaml | 3 +++ distil/service/api/v2/health.py | 3 ++- test-requirements.txt | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .zuul.yaml diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..148d7b2 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,3 @@ +- project: + templates: + - openstack-python-jobs diff --git a/distil/service/api/v2/health.py b/distil/service/api/v2/health.py index f5010dc..a8aa8e4 100644 --- a/distil/service/api/v2/health.py +++ b/distil/service/api/v2/health.py @@ -43,7 +43,8 @@ def get_health(): """ result = {} - projects_keystone = openstack.get_projects() + projects_keystone = openstack.get_projects( + domains=CONF.collector.include_domains) keystone_projects = [t['id'] for t in projects_keystone if t['name'] not in CONF.collector.ignore_tenants] diff --git a/test-requirements.txt b/test-requirements.txt index 3e415f5..41cfc53 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,8 @@ hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0 coverage>=4.0,!=4.4 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD -pylint==1.4.5 # GPLv2 +pylint>=1.4.5 # GPLv2 +pyflakes>=2.0 sqlalchemy-migrate>=0.11.0 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD