Get rid of ansible version checking

This commit is contained in:
Alan Rominger
2020-08-27 14:23:50 -04:00
committed by Ryan Petrello
parent 03ad1aa141
commit 99aff93930
5 changed files with 11 additions and 38 deletions

View File

@@ -162,13 +162,14 @@ def memoize_delete(function_name):
return cache.delete(function_name)
def _get_ansible_version(ansible_path):
@memoize()
def get_ansible_version():
'''
Return Ansible version installed.
Ansible path needs to be provided to account for custom virtual environments
'''
try:
proc = subprocess.Popen([ansible_path, '--version'],
proc = subprocess.Popen(['ansible', '--version'],
stdout=subprocess.PIPE)
result = smart_str(proc.communicate()[0])
return result.split('\n')[0].replace('ansible', '').strip()
@@ -176,11 +177,6 @@ def _get_ansible_version(ansible_path):
return 'unknown'
@memoize()
def get_ansible_version():
return _get_ansible_version('ansible')
def get_awx_version():
'''
Return AWX version as reported by setuptools.