From 56693d1665611adde6faadf81888fe29859586c2 Mon Sep 17 00:00:00 2001 From: Niranjan M.R Date: Apr 07 2020 06:24:29 +0000 Subject: Set permissions in octal mode for sshpass to read the file Signed-off-by: Niranjan M.R --- diff --git a/pytest_multihost/transport.py b/pytest_multihost/transport.py index b53a4d8..d939199 100644 --- a/pytest_multihost/transport.py +++ b/pytest_multihost/transport.py @@ -380,7 +380,7 @@ class OpenSSHTransport(Transport): elif self.host.ssh_password: password_file = os.path.join(self.control_dir.path, 'password') with open(password_file, 'w') as f: - os.fchmod(f.fileno(), 600) + os.fchmod(f.fileno(), 0o600) f.write(self.host.ssh_password) f.write('\n') argv = ['sshpass', '-f', password_file] + argv