Throw away everything but the first line when fetching the ansible version

This commit is contained in:
Matthew Jones 2014-10-08 13:30:36 -04:00
parent adb06fba4a
commit 71e87f7a41

View File

@ -78,7 +78,8 @@ def get_ansible_version():
proc = subprocess.Popen(['ansible', '--version'],
stdout=subprocess.PIPE)
result = proc.communicate()[0]
return result.lower().replace('ansible', '').strip()
stripped_result = result.lower().replace('ansible', '').strip()
return stripped_result.split('\n', 1)[0]
except:
return 'unknown'