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 committed 2019-11-05 17:24:24 +01:00
1 parent 09d5b938c1
commit b10e43c3ea
1 file changed
+1 -1
+1 -1
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'):