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/docker_image_availability.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/docker_image_availability.py')
-rw-r--r-- | roles/openshift_health_checker/openshift_checks/docker_image_availability.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/docker_image_availability.py b/roles/openshift_health_checker/openshift_checks/docker_image_availability.py index 77180223e..85a922f86 100644 --- a/roles/openshift_health_checker/openshift_checks/docker_image_availability.py +++ b/roles/openshift_health_checker/openshift_checks/docker_image_availability.py @@ -41,11 +41,10 @@ class DockerImageAvailability(DockerHostMixin, OpenShiftCheck): return super(DockerImageAvailability, self).is_active() and has_valid_deployment_type def run(self): - msg, failed, changed = self.ensure_dependencies() + msg, failed = self.ensure_dependencies() if failed: return { "failed": True, - "changed": changed, "msg": "Some dependencies are required in order to check Docker image availability.\n" + msg } @@ -54,11 +53,11 @@ class DockerImageAvailability(DockerHostMixin, OpenShiftCheck): # exit early if all images were found locally if not missing_images: - return {"changed": changed} + return {} registries = self.known_docker_registries() if not registries: - return {"failed": True, "msg": "Unable to retrieve any docker registries.", "changed": changed} + return {"failed": True, "msg": "Unable to retrieve any docker registries."} available_images = self.available_images(missing_images, registries) unavailable_images = set(missing_images) - set(available_images) @@ -70,10 +69,9 @@ class DockerImageAvailability(DockerHostMixin, OpenShiftCheck): "One or more required Docker images are not available:\n {}\n" "Configured registries: {}" ).format(",\n ".join(sorted(unavailable_images)), ", ".join(registries)), - "changed": changed, } - return {"changed": changed} + return {} def required_images(self): """ |