diff options
author | Luke Meyer <lmeyer@redhat.com> | 2017-07-20 22:25:47 -0400 |
---|---|---|
committer | Luke Meyer <lmeyer@redhat.com> | 2017-08-02 14:06:37 -0400 |
commit | bf0828bc0f2e3088df20abc77e30a162595e1c22 (patch) | |
tree | a46617defefce2cf180666ad441451f54d418704 /roles/openshift_health_checker/openshift_checks/mixins.py | |
parent | f6e0126c3cda6622fc2371b3b603108b94ed9d39 (diff) | |
download | openshift-bf0828bc0f2e3088df20abc77e30a162595e1c22.tar.gz openshift-bf0828bc0f2e3088df20abc77e30a162595e1c22.tar.bz2 openshift-bf0828bc0f2e3088df20abc77e30a162595e1c22.tar.xz openshift-bf0828bc0f2e3088df20abc77e30a162595e1c22.zip |
openshift_checks: add property to track 'changed'
Introduced the 'changed' property for checks that can make changes to
track whether they did or not. Rather than the check's own logic having
to track this and include it in the result hash, just set the property
and have the action plugin insert it in the result hash after running
(even if there is an exception).
Cleared out a lot of crufty "changed: false" hash entries.
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/mixins.py')
-rw-r--r-- | roles/openshift_health_checker/openshift_checks/mixins.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/mixins.py b/roles/openshift_health_checker/openshift_checks/mixins.py index 3b2c64e6a..e9bae60a3 100644 --- a/roles/openshift_health_checker/openshift_checks/mixins.py +++ b/roles/openshift_health_checker/openshift_checks/mixins.py @@ -29,10 +29,10 @@ class DockerHostMixin(object): """ Ensure that docker-related packages exist, but not on atomic hosts (which would not be able to install but should already have them). - Returns: msg, failed, changed + Returns: msg, failed """ if self.get_var("openshift", "common", "is_atomic"): - return "", False, False + return "", False # NOTE: we would use the "package" module but it's actually an action plugin # and it's not clear how to invoke one of those. This is about the same anyway: @@ -49,5 +49,5 @@ class DockerHostMixin(object): " {deps}\n{msg}" ).format(deps=',\n '.join(self.dependencies), msg=msg) failed = result.get("failed", False) or result.get("rc", 0) != 0 - changed = result.get("changed", False) - return msg, failed, changed + self.changed = result.get("changed", False) + return msg, failed |