This piece of code has worked in the past, but after I switched to a new laptop it no longer works. I am getting [Errno 11001] getaddrinfo failed error, and I am unsure as to what could be causing the issue. I have double-checked to make sure the URL and login credentials are correct. I can do an upload with WinScp just fine, and the certificates seem to be in working order.
try:
ssh_client=paramiko.SSHClient()
ssh_client.connect(hostname=url, username=username, password=password)
except:
ssh_client=paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname=url, username=username, password=password)
ftp_client=ssh_client.open_sftp()
ftp_client.chdir(upload)
ftp_client.put(r'oneroster11.zip',r'oneroster11.zip')
ftp_client.close()
It seems to be failing at line 3 so at ssh_client.connect(hostname=url, username=username, password=password)
. Any help would be appreciated.