Ejemplo n.º 1
0
 def initialize_app(self, argv):
     main.register_and_load_opts()
     # Don't pass argv here because cfg.CONF will intercept the
     # help options and exit.
     cfg.CONF(['--config-file', '/etc/akanda-rug/rug.ini'],
              project='akanda-rug')
     self.rug_ini = cfg.CONF
     return super(RugController, self).initialize_app(argv)
Ejemplo n.º 2
0
 def initialize_app(self, argv):
     # Quiet logging for some request library
     logging.getLogger('requests').setLevel(logging.WARN)
     main.register_and_load_opts()
     # Don't pass argv here because cfg.CONF will intercept the
     # help options and exit.
     cfg.CONF(['--config-file', '/etc/akanda-rug/rug.ini'],
              project='akanda-rug')
     self.rug_ini = cfg.CONF
     return super(RugController, self).initialize_app(argv)
Ejemplo n.º 3
0
 def initialize_app(self, argv):
     # Quiet logging for some request library
     logging.getLogger('requests').setLevel(logging.WARN)
     main.register_and_load_opts()
     # Don't pass argv here because cfg.CONF will intercept the
     # help options and exit.
     cfg.CONF(['--config-file', '/etc/akanda-rug/rug.ini'],
              project='akanda-rug')
     self.rug_ini = cfg.CONF
     return super(RugController, self).initialize_app(argv)
Ejemplo n.º 4
0
def debug_one_router(args=sys.argv[1:]):

    main.register_and_load_opts()

    # Add our extra option for specifying the router-id to debug
    cfg.CONF.register_cli_opts([
        cfg.StrOpt('router-id',
                   required=True,
                   help='The UUID for the router to debug',
                   ),
    ])
    cfg.CONF(args, project='akanda-rug')
    cfg.CONF.set_override('boot_timeout', 60000)

    logging.basicConfig(
        level=logging.DEBUG,
        format=':'.join('%(' + n + ')s'
                        for n in ['processName',
                                  'threadName',
                                  'name',
                                  'levelname',
                                  'message']),
    )

    log = logging.getLogger(__name__)
    log.debug('Proxy settings: %r', os.getenv('no_proxy'))

    context = worker.WorkerContext()
    router_obj = context.neutron.get_router_detail(cfg.CONF.router_id)
    a = state.Automaton(
        router_id=cfg.CONF.router_id,
        tenant_id=router_obj.tenant_id,
        delete_callback=delete_callback,
        bandwidth_callback=bandwidth_callback,
        worker_context=context,
        queue_warning_threshold=100,
        reboot_error_threshold=1,
    )

    a.send_message(Fake('update'))

    import pdb
    pdb.set_trace()

    a.update(context)
Ejemplo n.º 5
0
def debug_one_router(args=sys.argv[1:]):

    main.register_and_load_opts()

    # Add our extra option for specifying the router-id to debug
    cfg.CONF.register_cli_opts([
        cfg.StrOpt(
            'router-id',
            required=True,
            help='The UUID for the router to debug',
        ),
    ])
    cfg.CONF(args, project='akanda-rug')
    cfg.CONF.set_override('boot_timeout', 60000)

    logging.basicConfig(
        level=logging.DEBUG,
        format=':'.join(
            '%(' + n + ')s' for n in
            ['processName', 'threadName', 'name', 'levelname', 'message']),
    )

    log = logging.getLogger(__name__)
    log.debug('Proxy settings: %r', os.getenv('no_proxy'))

    context = worker.WorkerContext()
    router_obj = context.neutron.get_router_detail(cfg.CONF.router_id)
    a = state.Automaton(
        router_id=cfg.CONF.router_id,
        tenant_id=router_obj.tenant_id,
        delete_callback=delete_callback,
        bandwidth_callback=bandwidth_callback,
        worker_context=context,
        queue_warning_threshold=100,
        reboot_error_threshold=1,
    )

    a.send_message(Fake('update'))

    import pdb
    pdb.set_trace()

    a.update(context)
Ejemplo n.º 6
0
# Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


from akanda.rug.main import register_and_load_opts

register_and_load_opts()
Ejemplo n.º 7
0
# Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from akanda.rug.main import register_and_load_opts

register_and_load_opts()