mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 16:28:43 -03:30
Make using named pipe for adding passwords conditional on the version
of ssh used.
This commit is contained in:
@@ -27,7 +27,7 @@ from Crypto.Cipher import AES
|
||||
logger = logging.getLogger('awx.main.utils')
|
||||
|
||||
__all__ = ['get_object_or_400', 'get_object_or_403', 'camelcase_to_underscore',
|
||||
'get_ansible_version', 'get_awx_version', 'update_scm_url',
|
||||
'get_ansible_version', 'get_ssh_version', 'get_awx_version', 'update_scm_url',
|
||||
'get_type_for_model', 'get_model_for_type', 'to_python_boolean',
|
||||
'ignore_inventory_computed_fields', 'ignore_inventory_group_removal',
|
||||
'_inventory_updates', 'get_pk_from_dict']
|
||||
@@ -104,6 +104,17 @@ def get_ansible_version():
|
||||
except:
|
||||
return 'unknown'
|
||||
|
||||
def get_ssh_version():
|
||||
'''
|
||||
Return SSH version installed.
|
||||
'''
|
||||
try:
|
||||
proc = subprocess.Popen(['ssh', '-V'],
|
||||
stderr=subprocess.PIPE)
|
||||
result = proc.communicate()[1]
|
||||
return result.split(" ")[0].split("_")[1]
|
||||
except:
|
||||
return 'unknown'
|
||||
|
||||
def get_awx_version():
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user