summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_health_checker')
-rw-r--r--roles/openshift_health_checker/openshift_checks/etcd_traffic.py4
-rw-r--r--roles/openshift_health_checker/test/etcd_traffic_test.py6
2 files changed, 4 insertions, 6 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/etcd_traffic.py b/roles/openshift_health_checker/openshift_checks/etcd_traffic.py
index cc1b14d8a..b4c8957e9 100644
--- a/roles/openshift_health_checker/openshift_checks/etcd_traffic.py
+++ b/roles/openshift_health_checker/openshift_checks/etcd_traffic.py
@@ -14,8 +14,8 @@ class EtcdTraffic(OpenShiftCheck):
group_names = self.get_var("group_names", default=[])
valid_group_names = "etcd" in group_names
- version = self.get_var("openshift", "common", "short_version")
- valid_version = version in ("3.4", "3.5", "1.4", "1.5")
+ version = self.get_major_minor_version(self.get_var("openshift_image_tag"))
+ valid_version = version in ((3, 4), (3, 5))
return super(EtcdTraffic, self).is_active() and valid_group_names and valid_version
diff --git a/roles/openshift_health_checker/test/etcd_traffic_test.py b/roles/openshift_health_checker/test/etcd_traffic_test.py
index f4316c423..fae3e578d 100644
--- a/roles/openshift_health_checker/test/etcd_traffic_test.py
+++ b/roles/openshift_health_checker/test/etcd_traffic_test.py
@@ -8,7 +8,7 @@ from openshift_checks.etcd_traffic import EtcdTraffic
(['masters'], "3.6", False),
(['nodes'], "3.4", False),
(['etcd'], "3.4", True),
- (['etcd'], "3.5", True),
+ (['etcd'], "1.5", True),
(['etcd'], "3.1", False),
(['masters', 'nodes'], "3.5", False),
(['masters', 'etcd'], "3.5", True),
@@ -17,9 +17,7 @@ from openshift_checks.etcd_traffic import EtcdTraffic
def test_is_active(group_names, version, is_active):
task_vars = dict(
group_names=group_names,
- openshift=dict(
- common=dict(short_version=version),
- ),
+ openshift_image_tag=version,
)
assert EtcdTraffic(task_vars=task_vars).is_active() == is_active