summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2017-02-03 12:42:56 -0500
committerGitHub <noreply@github.com>2017-02-03 12:42:56 -0500
commit986dc852f38c8be69d2c3ca6da2f61f560ef1e5c (patch)
tree2a2b5c4c06ceb3c242d5b8d48e3a8cc059641546
parentadcf22d4ecf506ebc7ea74346df0f35d4f7e688d (diff)
parent404da9436efc69a615b29cded6230db29cb4e659 (diff)
downloadopenshift-986dc852f38c8be69d2c3ca6da2f61f560ef1e5c.tar.gz
openshift-986dc852f38c8be69d2c3ca6da2f61f560ef1e5c.tar.bz2
openshift-986dc852f38c8be69d2c3ca6da2f61f560ef1e5c.tar.xz
openshift-986dc852f38c8be69d2c3ca6da2f61f560ef1e5c.zip
Merge pull request #3255 from mtnbikenc/version-check
Add logic to verify patched version of Ansible
-rw-r--r--callback_plugins/aa_version_requirement.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/callback_plugins/aa_version_requirement.py b/callback_plugins/aa_version_requirement.py
index 40affb18b..f31445381 100644
--- a/callback_plugins/aa_version_requirement.py
+++ b/callback_plugins/aa_version_requirement.py
@@ -7,6 +7,7 @@ The plugin is named with leading `aa_` to ensure this plugin is loaded
first (alphanumerically) by Ansible.
"""
import sys
+from subprocess import check_output
from ansible import __version__
if __version__ < '2.0':
@@ -65,7 +66,11 @@ class CallbackModule(CallbackBase):
sys.exit(1)
if __version__ == '2.2.1.0':
- display(
- 'FATAL: Current Ansible version (%s) is not supported. %s'
- % (__version__, FAIL_ON_2_2_1_0), color='red')
- sys.exit(1)
+ rpm_ver = str(check_output(["rpm", "-qa", "ansible"]))
+ patched_ansible = '2.2.1.0-2'
+
+ if patched_ansible not in rpm_ver:
+ display(
+ 'FATAL: Current Ansible version (%s) is not supported. %s'
+ % (__version__, FAIL_ON_2_2_1_0), color='red')
+ sys.exit(1)