summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorLuke Meyer <lmeyer@redhat.com>2017-08-08 12:11:21 -0400
committerLuke Meyer <lmeyer@redhat.com>2017-08-15 20:14:46 -0400
commit0094265fbf7bf7cdde851629fd22216ae48e1082 (patch)
tree026df3aa86deb013de60a666281559491dcec19b /roles
parent667e1918efa55ff39980faed3f36ad58d12f637f (diff)
downloadopenshift-0094265fbf7bf7cdde851629fd22216ae48e1082.tar.gz
openshift-0094265fbf7bf7cdde851629fd22216ae48e1082.tar.bz2
openshift-0094265fbf7bf7cdde851629fd22216ae48e1082.tar.xz
openshift-0094265fbf7bf7cdde851629fd22216ae48e1082.zip
etc_traffic check: factor away short_version
Diffstat (limited to 'roles')
-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