'Sudo hook to catch commands to allow running on all hosts.'

def _fake_execute(self, *cmd, **kwargs):

    cmdlist = list(cmd)
    exe = cmdlist.pop(0)
    if (exe == 'vgc-cluster'):
        exe = cmdlist.pop(0)
        if (exe == 'request-cancel'):
            self._request_cancel = True
            if (self._return_blocked > 0):
                return ('Request    cancelled', '')
            else:
                raise processutils.ProcessExecutionError(exit_code=1)
        elif self._fail_vgc_cluster:
            raise processutils.ProcessExecutionError(exit_code=1)
        elif (exe == '--version'):
            return ('HGST    Solutions    V2.5.0.0.x.x.x.x.x', '')
        elif (exe == 'space-list'):
            return self._parse_space_list(cmdlist)
        elif (exe == 'space-create'):
            self._parse_space_create(cmdlist)
            if (self._return_blocked > 0):
                self._return_blocked = (self._return_blocked - 1)
                out = 'VGC_CREATE_000002\nBLOCKED\n'
                raise processutils.ProcessExecutionError(stdout=out, exit_code=1)
            return ('', '')
        elif (exe == 'space-delete'):
            return self._parse_space_delete(cmdlist)
        elif (exe == 'space-extend'):
            return self._parse_space_extend(cmdlist)
        elif (exe == 'host-storage'):
            if self._fail_host_storage:
                raise processutils.ProcessExecutionError(exit_code=1)
            return (HGST_HOST_STORAGE, '')
        elif (exe == 'domain-list'):
            return self._parse_domain_list()
        elif (exe == 'network-list'):
            return self._parse_network_list()
        elif (exe == 'space-set-apphosts'):
            if self._fail_set_apphosts:
                raise processutils.ProcessExecutionError(exit_code=1)
            return ('', '')
        else:
            raise NotImplementedError
    elif (exe == 'ip'):
        if self._fail_ip:
            raise processutils.ProcessExecutionError(exit_code=1)
        else:
            return (IP_OUTPUT, '')
    elif (exe == 'dd'):
        self.dd_count = (-1)
        for p in cmdlist:
            if ('count=' in p):
                self.dd_count = int(p[6:])
            elif ('bs=' in p):
                self.bs = p[3:]
        return (DD_OUTPUT, '')
    else:
        return ('', '')
