def domain_add(self, host=None): """ Activate a host with CacheBrowser """ if not host: raise InsufficientCommandParametersException('host') result_host = common.add_domain(host) if result_host: self.send_line("Host '%s' activated" % result_host) else: self.send_line("Host '%s' could not be activated, see logs for more information" % host)
def action_add_host(request): host = common.add_domain(request['host']) return{ 'result': 'success', 'host': host }
def action_add_host(self, message, cb): host = common.add_domain(message['host']) cb({ 'result': 'success', 'host': host })