Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyStr(str):
- def read(self):
- return self
- __builtin__.str = MyStr
- @classmethod
- def _get_connection(cls, hostname):
- client = paramiko.SSHClient()
- client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- if cls.options.ssh_key is None:
- client.connect(hostname=hostname, username=cls.options.user,
- password=cls.options.password)
- else:
- k = paramiko.RSAKey.from_private_key_file(cls.options.ssh_key)
- client.connect(hostname=hostname, username=cls.options.user,
- pkey=k)
- return client
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement