diff options
author | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-03-22 16:29:37 +0100 |
---|---|---|
committer | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-03-28 11:54:52 +0200 |
commit | 5e71e43a2a2e9089185d34e5406ee212cc478a75 (patch) | |
tree | 0b62a54db72e5614998ea2aa29517eb3f8296294 /roles/openshift_health_checker/openshift_checks/__init__.py | |
parent | f324d6d1040b6af82113a1e975903ae8fd64fef8 (diff) | |
download | openshift-5e71e43a2a2e9089185d34e5406ee212cc478a75.tar.gz openshift-5e71e43a2a2e9089185d34e5406ee212cc478a75.tar.bz2 openshift-5e71e43a2a2e9089185d34e5406ee212cc478a75.tar.xz openshift-5e71e43a2a2e9089185d34e5406ee212cc478a75.zip |
Rename module_executor -> execute_module
It is a function/callable, the name should imply action, should be a
verb and not a noun.
Keep supporting the old name while we have PRs in-flight that use the
old name.
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/__init__.py')
-rw-r--r-- | roles/openshift_health_checker/openshift_checks/__init__.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/__init__.py b/roles/openshift_health_checker/openshift_checks/__init__.py index 93547a2e0..72d0b26df 100644 --- a/roles/openshift_health_checker/openshift_checks/__init__.py +++ b/roles/openshift_health_checker/openshift_checks/__init__.py @@ -21,8 +21,13 @@ class OpenShiftCheckException(Exception): class OpenShiftCheck(object): """A base class for defining checks for an OpenShift cluster environment.""" - def __init__(self, module_executor): - self.module_executor = module_executor + 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 @abstractproperty def name(self): |