Example #1
0
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)
Example #2
0
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)
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
    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)
Example #6
0
    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)
Example #7
0
    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)
Example #8
0
    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)
Example #9
0
    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)
Example #10
0
    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)
Example #11
0
    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)