diff options
author | Luke Meyer <lmeyer@redhat.com> | 2017-06-16 17:24:01 -0400 |
---|---|---|
committer | Luke Meyer <lmeyer@redhat.com> | 2017-07-25 13:23:58 -0400 |
commit | 2a0936b291992ba1b7343680aec915df0c29892c (patch) | |
tree | 22fe8d099f5a1bc11a35ff1cdf0c05f9cef12053 /roles/openshift_health_checker/openshift_checks/__init__.py | |
parent | 3f3f87b7982b570ffb976865e3eace2d36960bd4 (diff) | |
download | openshift-2a0936b291992ba1b7343680aec915df0c29892c.tar.gz openshift-2a0936b291992ba1b7343680aec915df0c29892c.tar.bz2 openshift-2a0936b291992ba1b7343680aec915df0c29892c.tar.xz openshift-2a0936b291992ba1b7343680aec915df0c29892c.zip |
openshift_checks: get rid of deprecated module_executor
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/__init__.py')
-rw-r--r-- | roles/openshift_health_checker/openshift_checks/__init__.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/__init__.py b/roles/openshift_health_checker/openshift_checks/__init__.py index 5c9949ced..c2cfd0175 100644 --- a/roles/openshift_health_checker/openshift_checks/__init__.py +++ b/roles/openshift_health_checker/openshift_checks/__init__.py @@ -21,13 +21,12 @@ class OpenShiftCheckException(Exception): class OpenShiftCheck(object): """A base class for defining checks for an OpenShift cluster environment.""" - def __init__(self, execute_module=None, module_executor=None): - if execute_module is module_executor is None: - raise TypeError( - "__init__() takes either execute_module (recommended) " - "or module_executor (deprecated), none given") - self.execute_module = execute_module or module_executor - self.module_executor = self.execute_module + def __init__(self, execute_module=None): + def placeholder(*_): + """Fail tests more helpfully when execute_module not provided.""" + raise TypeError(self.__class__.__name__ + + " invoked execute_module without providing the method at initialization.") + self.execute_module = execute_module or placeholder @abstractproperty def name(self): |