Only use the first line of the pass output

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
This commit is contained in:
Jan Losinski 2019-01-18 11:54:34 +01:00
parent c271d9650c
commit 59e8468faa
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: AF7958914F414B08
1 changed files with 1 additions and 1 deletions

View File

@ -88,7 +88,7 @@ class LookupModule(LookupBase):
(stdout, stderr) = p.communicate() (stdout, stderr) = p.communicate()
if p.returncode == 0: if p.returncode == 0:
ret.append(stdout.decode("utf-8").rstrip()) ret.append(stdout.decode("utf-8").splitlines()[0].rstrip())
else: else:
err = stderr.decode("utf-8").rstrip() err = stderr.decode("utf-8").rstrip()
raise AnsibleError("lookup_plugin.pass(%s) returned %d: %s" % (term, p.returncode, err)) raise AnsibleError("lookup_plugin.pass(%s) returned %d: %s" % (term, p.returncode, err))