mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-05 16:01:50 -05:00
Get rid of ansible version checking
This commit is contained in:
committed by
Ryan Petrello
parent
03ad1aa141
commit
99aff93930
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user