summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/openshift_checks/package_version.py
diff options
context:
space:
mode:
authorRodolfo Carvalho <rhcarvalho@gmail.com>2017-02-06 17:06:18 +0100
committerRodolfo Carvalho <rhcarvalho@gmail.com>2017-02-10 19:49:01 +0100
commitf502b09c103b5d8681854b7ab6a3c9655311f73b (patch)
tree92a10933acc42815ed14f9516b41d4028ed771d6 /roles/openshift_health_checker/openshift_checks/package_version.py
parentd6cebd0f5c43762469b1218e1e4e4bdb608cda19 (diff)
downloadopenshift-f502b09c103b5d8681854b7ab6a3c9655311f73b.tar.gz
openshift-f502b09c103b5d8681854b7ab6a3c9655311f73b.tar.bz2
openshift-f502b09c103b5d8681854b7ab6a3c9655311f73b.tar.xz
openshift-f502b09c103b5d8681854b7ab6a3c9655311f73b.zip
Refactor code to access values from task_vars
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/package_version.py')
-rw-r--r--roles/openshift_health_checker/openshift_checks/package_version.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/package_version.py b/roles/openshift_health_checker/openshift_checks/package_version.py
index 9394466f2..b31b4d401 100644
--- a/roles/openshift_health_checker/openshift_checks/package_version.py
+++ b/roles/openshift_health_checker/openshift_checks/package_version.py
@@ -1,5 +1,5 @@
# pylint: disable=missing-docstring
-from openshift_checks import OpenShiftCheck, OpenShiftCheckException
+from openshift_checks import OpenShiftCheck, get_var
from openshift_checks.mixins import NotContainerized
@@ -17,10 +17,7 @@ class PackageVersion(NotContainerized, OpenShiftCheck):
)
def run(self, tmp, task_vars):
- try:
- openshift_release = task_vars["openshift_release"]
- except (KeyError, TypeError):
- raise OpenShiftCheckException("'openshift_release' is undefined")
+ openshift_release = get_var(task_vars, "openshift_release")
args = {"version": openshift_release}
return self.module_executor("aos_version", args, tmp, task_vars)