def mount(self):
        if self.mounted:
            return

        self._mount_point_local_create()

        if len(self.system.mount_opts) == 0:
            sshfs_opts = ""
        else:
            sshfs_opts = " -o %s" % " -o ".join(self.system.mount_opts)

        if self.system.auth_method == self.system.AUTH_METHOD_PUBLIC_KEY:
            ssh_opts = '-o PreferredAuthentications=publickey -i %s' % self.system.ssh_key
        else:
            ssh_opts = '-o PreferredAuthentications=password'

        cmd = ("{cmd_before_mount} &&"
               " sshfs -o ssh_command="
               "'ssh -o ConnectTimeout={timeout} -p {port} {ssh_opts}'"
               " {sshfs_opts} {user}@{host}:{remote_path} {local_path}")
        cmd = cmd.format(
            cmd_before_mount = self.system.cmd_before_mount,
            timeout = self.SSH_CONNECT_TIMEOUT,
            port = self.system.port,
            ssh_opts = ssh_opts,
            sshfs_opts = sshfs_opts,
            host = self.system.host,
            user = self.system.user,
            remote_path = self.mount_point_remote,
            local_path = self.mount_point_local,
        )

        output = shell_exec(cmd).strip()

        if not self.mounted:
            # Clean up the directory tree
            self._mount_point_local_delete()
            if output == '':
                output = 'Mounting failed for a reason unknown to sftpman.'
            raise SftpMountException(cmd, output)
you almost certainly want to use lock_row inside a commit_on_success function
dataset/ETHPy150Open spantaleev/sftpman/sftpman/model.py/SystemControllerModel.mount--crossover with--dataset/ETHPy150Open benadida/helios-server/helios/utils.py/lock_row