def connect(self):
try:<EOL><INDENT>self.client.connect(self.host, username=self.username,<EOL>password=self.password, port=self.port,<EOL>pkey=self.pkey, timeout=self.timeout)<EOL><DEDENT>except sock_gaierror as ex:<EOL><INDENT>raise Exception("<STR_LIT>" % self.host)<EOL><DEDENT>except sock_error as ex:<EOL><INDENT>raise Exception("<STR_LIT>" % (self.host, self.port, ex))<EOL><DEDENT>except paramiko.AuthenticationException as ex:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise Exception("<STR_LIT>" % self.host)<EOL><DEDENT>except paramiko.SSHException as ex:<EOL><INDENT>msg = "<STR_LIT>" % ex<EOL>raise Exception(msg)<EOL><DEDENT>
Connect to host