def mount(self):
if self.mounted:<EOL><INDENT>return<EOL><DEDENT>self._mount_point_local_create()<EOL>if len(self.system.mount_opts) == <NUM_LIT:0>:<EOL><INDENT>sshfs_opts = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>sshfs_opts = "<STR_LIT>" % "<STR_LIT>".join(self.system.mount_opts)<EOL><DEDENT>if self.system.auth_method == self.system.AUTH_METHOD_PUBLIC_KEY:<EOL><INDENT>ssh_opts = '<STR_LIT>' % self.system.ssh_key<EOL><DEDENT>elif self.system.auth_method:<EOL><INDENT>ssh_opts = '<STR_LIT>' % self.system.auth_method<EOL><DEDENT>else:<EOL><INDENT>ssh_opts = '<STR_LIT>'<EOL><DEDENT>cmd = ("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>cmd = cmd.format(<EOL>cmd_before_mount = self.system.cmd_before_mount,<EOL>timeout = self.SSH_CONNECT_TIMEOUT,<EOL>port = self.system.port,<EOL>ssh_opts = ssh_opts,<EOL>sshfs_opts = sshfs_opts,<EOL>host = self.system.host,<EOL>user = self.system.user,<EOL>remote_path = self.mount_point_remote,<EOL>local_path = self.mount_point_local,<EOL>)<EOL>output = shell_exec(cmd).strip()<EOL>if not self.mounted:<EOL><INDENT>self._mount_point_local_delete()<EOL>if output == '<STR_LIT>':<EOL><INDENT>output = '<STR_LIT>'<EOL><DEDENT>raise SftpMountException(cmd, output)<EOL><DEDENT>
Mounts the sftp system if it's not already mounted.