diff options
author | Michael Gugino <mgugino@redhat.com> | 2018-01-03 13:55:29 -0500 |
---|---|---|
committer | Michael Gugino <mgugino@redhat.com> | 2018-01-05 00:05:24 -0500 |
commit | edde1f2bf0fa180fc69d905ce2aa27e68f7295dd (patch) | |
tree | 8b62ec99b26f86063ea0b178e8c2ed4715eff2db /roles/openshift_health_checker/openshift_checks/__init__.py | |
parent | 9f19afc7529bd7293433b27e834b9ee3479e646f (diff) | |
download | openshift-edde1f2bf0fa180fc69d905ce2aa27e68f7295dd.tar.gz openshift-edde1f2bf0fa180fc69d905ce2aa27e68f7295dd.tar.bz2 openshift-edde1f2bf0fa180fc69d905ce2aa27e68f7295dd.tar.xz openshift-edde1f2bf0fa180fc69d905ce2aa27e68f7295dd.zip |
Fix docker_image_availability checks
This commit ensures that oreg_url is properly templated
by ansible before being consumed in the logic.
This commit also adds a method to the base health check
class to detect if self._templar is none, and return
the appropriate templated/untemplated version of the
variable. This is mostly for unit tests.
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/__init__.py')
-rw-r--r-- | roles/openshift_health_checker/openshift_checks/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/__init__.py b/roles/openshift_health_checker/openshift_checks/__init__.py index b7b16e0ea..83e551b5d 100644 --- a/roles/openshift_health_checker/openshift_checks/__init__.py +++ b/roles/openshift_health_checker/openshift_checks/__init__.py @@ -95,6 +95,13 @@ class OpenShiftCheck(object): # These are intended to be a sequential record of what the check observed and determined. self.logs = [] + def template_var(self, var_to_template): + """Return a templated variable if self._templar is not None, else + just return the variable as-is""" + if self._templar is not None: + return self._templar.template(var_to_template) + return var_to_template + @abstractproperty def name(self): """The name of this check, usually derived from the class name.""" |