def send_api_fault(url, status, exception): """ Send an api.fault notification. """ if not CONF.notify_api_faults: return payload = {"url": url, "exception": str(exception), "status": status} rpc.get_notifier("api").error(None, "api.fault", payload)
def send_api_fault(url, status, exception): """ Send an api.fault notification. """ if not CONF.notify_api_faults: return payload = {'url': url, 'exception': str(exception), 'status': status} rpc.get_notifier('api').error(None, 'api.fault', payload)
def __init__(self, host=None, db_driver=None, service_name='undefined'): if not host: host = CONF.host self.host = host self.backdoor_port = None self.service_name = service_name self.notifier = rpc.get_notifier(self.service_name, self.host) self.additional_endpoints = [] super(Manager, self).__init__(db_driver)
def wrapped_func(*args, **kwarg): body = {} body["args"] = [] body["kwarg"] = {} for arg in args: body["args"].append(arg) for key in kwarg: body["kwarg"][key] = kwarg[key] ctxt = common_context.get_context_from_function_and_args(fn, args, kwarg) notifier = rpc.get_notifier(publisher_id=(CONF.default_publisher_id or CONF.host)) method = notifier.getattr(CONF.default_notification_level.lower(), "info") method(ctxt, name, body) return fn(*args, **kwarg)
def wrapped_func(*args, **kwarg): body = {} body['args'] = [] body['kwarg'] = {} for arg in args: body['args'].append(arg) for key in kwarg: body['kwarg'][key] = kwarg[key] ctxt = common_context.get_context_from_function_and_args( fn, args, kwarg) notifier = rpc.get_notifier(publisher_id=(CONF.default_publisher_id or CONF.host)) method = notifier.getattr(CONF.default_notification_level.lower(), 'info') method(ctxt, name, body) return fn(*args, **kwarg)
def __init__(self, **kwargs): self.controller_rpcapi = controller_rpcapi.ControllerRPCAPI() self.manager = manager.ControllerManager() self.notifier = rpc.get_notifier('controller', CONF.controller) super(API, self).__init__(**kwargs)
def __init__(self, **kwargs): self.vms_rpcapi = vms_rpcapi.VmRPCAPI() self.manager = manager.VmManager() self.notifier = rpc.get_notifier('vms', CONF.vm) super(API, self).__init__(**kwargs)
def __init__(self, **kwargs): self.hosts_rpcapi = hosts_rpcapi.HostRPCAPI() self.manager = manager.HostManager() self.notifier = rpc.get_notifier('hosts', CONF.host) super(API, self).__init__(**kwargs)