Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2016
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. import paramiko
  2.  
  3. def worker_handler(event, context):
  4.  
  5. host = "sftpserver.testdpom.com"
  6. port = 22
  7. transport = paramiko.Transport((host, port))
  8.  
  9. sftp = paramiko.SFTPClient.from_transport(transport)
  10.  
  11. username = "xxxx"
  12. password = "xxxxxx"
  13.  
  14. transport.connect(username = username, password = password)
  15.  
  16. sftp = paramiko.SFTPClient.from_transport(transport)
  17.  
  18. sftp.put("test.txt", "test.txt")
  19. sftp.close()
  20. transport.close()
  21.  
  22. return
  23. {
  24. 'message' : "Script execution completed. See Cloudwatch logs for complete output"
  25. }
  26.  
  27. File "/var/task/paramiko/kex_group1.py", line 111, in _parse_kexdh_reply
  28. self.transport._verify_key(host_key, sig)
  29. File "/var/task/paramiko/transport.py", line 1617, in _verify_key
  30. key = self._key_info[self.host_key_type](Message(host_key))
  31. File "/var/task/paramiko/rsakey.py", line 58, in __init__
  32. ).public_key(default_backend())
  33. File "/var/task/cryptography/hazmat/backends/__init__.py", line 35, in default_backend
  34. _default_backend = MultiBackend(_available_backends())
  35. File "/var/task/cryptography/hazmat/backends/__init__.py", line 22, in _available_backends
  36. "cryptography.backends"
  37. File "/var/task/pkg_resources/__init__.py", line 2235, in resolve
  38. module = __import__(self.module_name, fromlist=['__name__'], level=0)
  39. File "/var/task/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
  40. from cryptography.hazmat.backends.openssl.backend import backend
  41. File "/var/task/cryptography/hazmat/backends/openssl/backend.py", line 15, in <module>
  42. from cryptography import utils, x509
  43. File "/var/task/cryptography/x509/__init__.py", line 7, in <module>
  44. from cryptography.x509.base import (
  45. File "/var/task/cryptography/x509/base.py", line 15, in <module>
  46. from cryptography.x509.extensions import Extension, ExtensionType
  47. File "/var/task/cryptography/x509/extensions.py", line 19, in <module>
  48. from cryptography.hazmat.primitives import constant_time, serialization
  49. File "/var/task/cryptography/hazmat/primitives/constant_time.py", line 9, in <module>
  50. from cryptography.hazmat.bindings._constant_time import lib
  51. ImportError: No module named _constant_time
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement