Skip to content

Commit

Permalink
smoketest: ssh_send_cmd should be a static method
Browse files Browse the repository at this point in the history
  • Loading branch information
jestabro committed Jun 25, 2023
1 parent f932180 commit b5346bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion smoketest/scripts/cli/base_vyostest_shim.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ def getFRRconfig(self, string, end='$', endsection='^!', daemon=''):
pprint.pprint(out)
return out

@staticmethod
def ssh_send_cmd(command, username, password, hostname='localhost'):
""" SSH command execution helper """
# Try to login via SSH
ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname=hostname, username=username, password=password)
print(host, username, password)
_, stdout, stderr = ssh_client.exec_command(command)
output = stdout.read().decode().strip()
error = stderr.read().decode().strip()
Expand Down

0 comments on commit b5346bc

Please sign in to comment.