mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-14 00:18:36 -05:00
Primary development of inventory plugins, partial compat layer
Initialize some inventory plugin test data files Implement openstack inventory plugin This may be removed later: - port non-JSON line strip method from core Dupliate effort with AWX mainline devel - Produce ansible_version related to venv Refactor some of injector management, moving more of this overhead into tasks.py, when it comes to managing injector kwargs Upgrade and move openstack inventory script sync up parameters Add extremely detailed logic to inventory file creation for ec2, Azure, and gce so that they are closer to a genuine superset of what the contrib script used to give.
This commit is contained in:
@@ -153,13 +153,13 @@ def memoize_delete(function_name):
|
||||
return cache.delete(function_name)
|
||||
|
||||
|
||||
@memoize()
|
||||
def get_ansible_version():
|
||||
def _get_ansible_version(ansible_path):
|
||||
'''
|
||||
Return Ansible version installed.
|
||||
Ansible path needs to be provided to account for custom virtual environments
|
||||
'''
|
||||
try:
|
||||
proc = subprocess.Popen(['ansible', '--version'],
|
||||
proc = subprocess.Popen([ansible_path, '--version'],
|
||||
stdout=subprocess.PIPE)
|
||||
result = smart_str(proc.communicate()[0])
|
||||
return result.split('\n')[0].replace('ansible', '').strip()
|
||||
@@ -167,6 +167,11 @@ def get_ansible_version():
|
||||
return 'unknown'
|
||||
|
||||
|
||||
@memoize()
|
||||
def get_ansible_version(ansible_path='ansible'):
|
||||
return _get_ansible_version(ansible_path)
|
||||
|
||||
|
||||
@memoize()
|
||||
def get_ssh_version():
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user