diff options
author | juanvallejo <jvallejo@redhat.com> | 2017-06-26 17:41:40 -0400 |
---|---|---|
committer | juanvallejo <jvallejo@redhat.com> | 2017-08-01 17:25:40 -0400 |
commit | 04154a21237f9da6ee64bf57097d125b85b99a5f (patch) | |
tree | 1d17e8bceefd45e8da6741813fc136c892b27429 /roles/openshift_health_checker/openshift_checks/__init__.py | |
parent | 01e48932d615dd17c316c1b9ab00216ab0f3f78d (diff) | |
download | openshift-04154a21237f9da6ee64bf57097d125b85b99a5f.tar.gz openshift-04154a21237f9da6ee64bf57097d125b85b99a5f.tar.bz2 openshift-04154a21237f9da6ee64bf57097d125b85b99a5f.tar.xz openshift-04154a21237f9da6ee64bf57097d125b85b99a5f.zip |
add fluentd logging driver config check
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/__init__.py')
-rw-r--r-- | roles/openshift_health_checker/openshift_checks/__init__.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/__init__.py b/roles/openshift_health_checker/openshift_checks/__init__.py index 40a28cde5..85cbc6224 100644 --- a/roles/openshift_health_checker/openshift_checks/__init__.py +++ b/roles/openshift_health_checker/openshift_checks/__init__.py @@ -105,6 +105,29 @@ class OpenShiftCheck(object): raise OpenShiftCheckException("'{}' is undefined".format(".".join(map(str, keys)))) return value + @staticmethod + def get_major_minor_version(openshift_image_tag): + """Parse and return the deployed version of OpenShift as a tuple.""" + if openshift_image_tag and openshift_image_tag[0] == 'v': + openshift_image_tag = openshift_image_tag[1:] + + # map major release versions across releases + # to a common major version + openshift_major_release_version = { + "1": "3", + } + + components = openshift_image_tag.split(".") + if not components or len(components) < 2: + msg = "An invalid version of OpenShift was found for this host: {}" + raise OpenShiftCheckException(msg.format(openshift_image_tag)) + + if components[0] in openshift_major_release_version: + components[0] = openshift_major_release_version[components[0]] + + components = tuple(int(x) for x in components[:2]) + return components + LOADER_EXCLUDES = ( "__init__.py", |