mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Guard against a shell profile printing extraneous data
This commit is contained in:
@@ -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 = '/'
|
||||
|
||||
Reference in New Issue
Block a user