Ejemplo n.º 1
0
    def __init__(self, conf):
        self.conf = conf
        self.conf.register_opts(_GENERAL_OPTIONS)
        self.conf.register_opts(_DRIVER_OPTIONS, group=_DRIVER_GROUP)
        self.driver_conf = self.conf[_DRIVER_GROUP]

        log.setup('marconi')
Ejemplo n.º 2
0
    def __init__(self, conf):
        self.conf = conf
        self.conf.register_opts(_GENERAL_OPTIONS)
        self.conf.register_opts(_DRIVER_OPTIONS, group=_DRIVER_GROUP)
        self.driver_conf = self.conf[_DRIVER_GROUP]

        log.setup('marconi')
Ejemplo n.º 3
0
 def _wrapper():
     try:
         logging.setup('marconi')
         func()
     except KeyboardInterrupt:
         LOG.info(_(u'Terminating'))
     except Exception as ex:
         _fail(1, ex)
Ejemplo n.º 4
0
 def _wrapper():
     try:
         logging.setup('marconi')
         func()
     except KeyboardInterrupt:
         LOG.info(_(u'Terminating'))
     except Exception as ex:
         _fail(1, ex)
Ejemplo n.º 5
0
    def __init__(self, conf):
        self.conf = conf
        self.conf.register_opts(_GENERAL_OPTIONS)
        self.conf.register_opts(_DRIVER_OPTIONS, group=_DRIVER_GROUP)
        self.driver_conf = self.conf[_DRIVER_GROUP]

        log.setup('marconi')
        mode = 'admin' if conf.admin_mode else 'public'
        self._transport_type = 'marconi.queues.{0}.transport'.format(mode)
Ejemplo n.º 6
0
    def __init__(self, conf):
        self.conf = conf
        self.conf.register_opts(_GENERAL_OPTIONS)
        self.conf.register_opts(_DRIVER_OPTIONS, group=_DRIVER_GROUP)
        self.driver_conf = self.conf[_DRIVER_GROUP]

        log.setup('marconi')
        mode = 'admin' if conf.admin_mode else 'public'
        self._transport_type = 'marconi.queues.{0}.transport'.format(mode)
Ejemplo n.º 7
0
    def _wrapper():
        atexit.register(_enable_echo, True)
        _enable_echo(False)

        try:
            logging.setup('marconi')
            func()
        except KeyboardInterrupt:
            LOG.info(_(u'Terminating'))
        except Exception as ex:
            _fail(1, ex)
Ejemplo n.º 8
0
    def _wrapper():
        atexit.register(_enable_echo, True)
        _enable_echo(False)

        try:
            logging.setup('marconi')
            func()
        except KeyboardInterrupt:
            LOG.info(_(u'Terminating'))
        except Exception as ex:
            _fail(1, ex)
Ejemplo n.º 9
0
    def _wrapper():
        atexit.register(_enable_echo, True)
        _enable_echo(False)

        try:
            logging.setup('marconi')
            PROJECT_CFG.load(args=sys.argv[1:])
            func()
        except KeyboardInterrupt:
            LOG.info('Terminating')
        except Exception as ex:
            _fail(1, ex)
Ejemplo n.º 10
0
    def __init__(self, access_mode, config_file=None, cli_args=None):
        default_file = None
        if config_file is not None:
            default_file = [config_file]

        CFG(project='marconi',
            args=cli_args or [],
            default_config_files=default_file)

        log.setup('marconi_proxy')
        form = 'marconi.proxy.{0}.transport'
        lookup = {access.Access.public: 'public', access.Access.admin: 'admin'}
        self._transport_type = form.format(lookup[access_mode])
Ejemplo n.º 11
0
    def __init__(self, access_mode, config_file=None, cli_args=None):
        default_file = None
        if config_file is not None:
            default_file = [config_file]

        CFG(project='marconi', args=cli_args or [],
            default_config_files=default_file)

        log.setup('marconi_proxy')
        form = 'marconi.proxy.{0}.transport'
        lookup = {access.Access.public: 'public',
                  access.Access.admin: 'admin'}
        self._transport_type = form.format(lookup[access_mode])
Ejemplo n.º 12
0
 def __init__(self, config_file=None, cli_args=None):
     PROJECT_CFG.load(filename=config_file, args=cli_args)
     log.setup('marconi')