mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
Guard against a shell profile printing extraneous data
This commit is contained in:
parent
4d59779e0a
commit
1cee3f35b1
3 changed files with 10 additions and 9 deletions
|
@ -240,7 +240,8 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|||
raise AnsibleConnectionFailure(output)
|
||||
|
||||
try:
|
||||
rc = self._connection._shell.join_path(result['stdout'].strip(), u'').splitlines()[-1]
|
||||
stdout_parts = result['stdout'].strip().split('%s=' % basefile, 1)
|
||||
rc = self._connection._shell.join_path(stdout_parts[-1], u'').splitlines()[-1]
|
||||
except IndexError:
|
||||
# stdout was empty or just space, set to / to trigger error in next if
|
||||
rc = '/'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue