Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Revert "[Fix] Fix ssh issue, when the password is not None."
Browse files Browse the repository at this point in the history
This reverts commit 59128d1.
  • Loading branch information
Gerhut committed Feb 25, 2019
1 parent 59128d1 commit 879eec0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions deployment/k8sPaiLibrary/maintainlib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ def sftp_paramiko(src, dst, filename, host_config):
ssh.connect(hostname=hostip, port=port, key_filename=key_filename, username=username, password=password)

stdin, stdout, stderr = ssh.exec_command("sudo mkdir -p {0}".format(dst), get_pty=True)
password = password if password is not None else ''
stdin.write(password + '\n')
stdin.write(password if password is not None else '' + '\n')
stdin.flush()
for response_msg in stdout:
print(response_msg.encode('utf-8').strip('\n'))
Expand Down Expand Up @@ -314,8 +313,7 @@ def ssh_shell_with_password_input_paramiko(host_config, commandline):
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname=hostip, port=port, key_filename=key_filename, username=username, password=password)
stdin, stdout, stderr = ssh.exec_command(commandline, get_pty=True)
password = password if password is not None else ''
stdin.write(password + '\n')
stdin.write(password if password is not None else '' + '\n')
stdin.flush()
logger.info("Executing the command on host [{0}]: {1}".format(hostip, commandline))
for response_msg in stdout:
Expand Down

0 comments on commit 879eec0

Please sign in to comment.