ipatests: strip newline character when getting name of temp file

Function create_temp_file was returning unprocessed output of mktemp
command, which contains a trailing newline. Callers which tryed to write
to the temp file were creating a new one instead.

Reviewed-By: Michal Polovka <mpolovka@redhat.com>
This commit is contained in:
Sergey Orlov
2019-11-01 10:47:34 +01:00
parent 09d5b938c1
commit b10e43c3ea

View File

@@ -1870,7 +1870,7 @@ def create_temp_file(host, directory=None):
cmd = ['mktemp']
if directory is not None:
cmd += ['-p', directory]
return host.run_command(cmd).stdout_text
return host.run_command(cmd).stdout_text.strip()
def create_active_user(host, login, password, first='test', last='user'):