Exemple #1
0
 def __init__(self, recipe, log, hostname, username, password, port):
     SSHClient.__init__(self)
     self.load_system_host_keys()
     self.set_missing_host_key_policy(AutoAddPolicy())
     self.connect(hostname=hostname, port=port, username=username, password=password)
     self.recipe = recipe
     self.log = log
Exemple #2
0
 def __init__(self,
              name,
              missionid,
              host,
              port,
              username,
              frequency=1,
              count=30,
              password=None,
              pkeycontent=None,
              **kwargs):
     SSHClient.__init__(self)
     self.name = name
     self.missionid = missionid
     self.frequency = frequency
     self.count = count
     self.homedir = "/home/%s" % username if username != "root" else "/root"
     self.set_missing_host_key_policy(AutoAddPolicy())
     key = StringIO(pkeycontent)
     pkey = RSAKey.from_private_key(key) if pkeycontent else None
     self.connect(hostname=host,
                  port=port,
                  username=username,
                  password=password,
                  pkey=pkey,
                  **kwargs)
     self.sftpclient = self.open_sftp()
Exemple #3
0
 def __init__(self, hostname, private_ip, public_ip):
     SSHClient.__init__(self)
     self.hostname = hostname
     self.public_ip = public_ip
     self.private_ip = private_ip
     self.load_system_host_keys()
     self.set_missing_host_key_policy(AutoAddPolicy())
     self.connect(hostname=hostname, username="******")
     self.sftp = self.open_sftp()
     if args.updateos:
         uthread = UpdateThread(self)
         uthread.start()
         uthread.name = "UpdateThread-%s" % hostname
Exemple #4
0
 def __init__(self, host_ip, user_name, password=None, key_filename=None):
     SSHClient.__init__(self)
     #super(SshConnection, self).__init__()
     try:
         socket.inet_aton(host_ip)
     except socket.error:
         logger.error("'%s' is not a valid IP address" % host_ip)
         raise
     self.host_ip = host_ip
     self.user_name = user_name
     self.password = password
     self.key_filename = key_filename
     logging.getLogger("paramiko").setLevel(logging.ERROR)
Exemple #5
0
 def __init__(self):
     SSHClient.__init__(self)
     self.login_status = None
 def __init__(self, chost, cpasswd):
     SSHClient.__init__(self)
     self.chost = chost
     self.cpassed = cpasswd
     self.set_missing_host_key_policy(AutoAddPolicy())
     self.connect(chost, port=22, username='******', password=cpasswd) 
Exemple #7
0
    def __init__(self):
        SSHClient.__init__(self)
	self.login_status = None
Exemple #8
0
 def __init__(self, address, credentials, port=None):
     Connector.__init__(self, address, credentials, port)
     SSHClient.__init__(self)