def main(): CONF(sys.argv[1:], project='oslo') logging.setup("oslo") with contextlib.closing(impl_zmq.ZmqProxy(CONF)) as reactor: reactor.consume_in_thread() reactor.wait()
def setup_logging(conf): """Sets up the logging options for a log with supplied name. :param conf: a cfg.ConfOpts object """ product_name = "neutron" logging.setup(product_name) LOG.info(_("Logging enabled!"))
def setup_logging(conf): """Sets up the logging options for a log with supplied name. :param conf: a cfg.ConfOpts object """ product_name = "neutron" logging.setup(product_name) LOG.info(_("Logging enabled!"))
def setup_logging(): """Sets up the logging options for a log with supplied name.""" product_name = "neutron" logging.setup(product_name) LOG.info(_LI("Logging enabled!")) LOG.info(_LI("%(prog)s version %(version)s"), {'prog': sys.argv[0], 'version': version.version_info.release_string()}) LOG.debug("command line: %s" % " ".join(sys.argv))
def init_config(): """Initialize configuration for this script""" logging.setup("sync_network") cfgfile = get_config_files() cfg.CONF( args = [j for i in zip(["--config-file"]*len(cfgfile), cfgfile) for j in i], project = "neutron", ) cfg.CONF.set_override('control_exchange', '') cfg.CONF.set_override('rpc_backend', 'neutron.openstack.common.rpc.impl_fake') cfg.CONF.set_override('verbose', True) cfg.CONF.set_override('debug', True)
def init_config(): """Initialize configuration for this script""" logging.setup("sync_network") cfgfile = get_config_files() cfg.CONF( args=[ j for i in zip(["--config-file"] * len(cfgfile), cfgfile) for j in i ], project="neutron", ) cfg.CONF.set_override('control_exchange', '') cfg.CONF.set_override('rpc_backend', 'neutron.openstack.common.rpc.impl_fake') cfg.CONF.set_override('verbose', True) cfg.CONF.set_override('debug', True)
def init_config(): """Initialize configuration for this script""" logging.setup("sync_network") cfgfile = get_config_files() cfg.CONF( args=[j for i in zip(["--config-file"]*len(cfgfile), cfgfile) for j in i], project="neutron", ) cfg.CONF.set_override('control_exchange', '') cfg.CONF.set_override('rpc_backend', 'neutron.openstack.common.rpc.impl_fake') cfg.CONF.set_override('verbose', True) cfg.CONF.set_override('debug', True) config.register_config() cfg.CONF.set_override('consistency_interval', 0, 'RESTPROXY') cfg.CONF.set_override('sync_data', False, 'RESTPROXY') # override to suppress annoying mysql mode warning session.LOG.warning = lambda *args, **kwargs: True # replace watchdog so it doesn't try to start servermanager.ServerPool._consistency_watchdog = lambda x, y: True
import logging as py_logging from neutron.openstack.common import log as logging logging.setup("swtich") # TODO(morgbara) figure out how to use a config file for this LOG = logging.getLogger('baremetal_neutron_extension.drivers.cisco.driver') LOG.logger.setLevel(py_logging.DEBUG) from baremetal_neutron_extension.drivers import base from baremetal_neutron_extension.drivers.cisco import driver as cisco_driver def create_port(port, driver): driver.create(port) def delete_port(port, driver): driver.delete(port) def add_vlan(port, driver): driver.attach(port) def remove_vlan(port, driver): driver.detach(port) def show(port, driver): driver.show(port)
def setup_logging(): logging.setup("neutron") logging.getLogger("neutron").logger LOG.debug("Logging setup complete")
def __init__(self): super(MonitorNeutronAgentsDaemon, self).__init__() logging.setup('Neuron-HA-Monitor') LOG.info('Monitor Neutron Agent Loop Init') self.hostname = None self.env = {}
LOG.error('Restart service: %s' % s) subprocess.check_output(restart) if s == 'neutron-metadata-agent': subprocess.check_output(['sudo', 'service', 'neutron-vpn-agent', 'restart']) def run(self): while True: LOG.info('Monitor Neutron HA Agent Loop Start') quantum = self.get_quantum_client() self.reassign_agent_resources(quantum=quantum) self.check_ovs_tunnel(quantum=quantum) self.check_local_agents() LOG.info('sleep %s' % cfg.CONF.check_interval) time.sleep(float(cfg.CONF.check_interval)) if __name__ == '__main__': opts = [ cfg.StrOpt('check_interval', default=8, help='Check Neutron Agents interval.'), ] cfg.CONF.register_cli_opts(opts) cfg.CONF(project='monitor_neutron_agents', default_config_files=[]) logging.setup('Neuron-HA-Monitor') monitor_daemon = MonitorNeutronAgentsDaemon() monitor_daemon.start()
def setup_logging(): """Sets up the logging options for a log with supplied name.""" product_name = "neutron" logging.setup(product_name) LOG.info(_("Logging enabled!"))
def setup_logging(): """Sets up the logging options for a log with supplied name.""" product_name = "neutron" logging.setup(product_name) LOG.info(_("Logging enabled!"))
from neutron.openstack.common import log as logging from neutron.common import config logging.setup('neutron') config.parse(['--config-file', '/etc/neutron/neutron.conf', '--config-file', '/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini']) application = config.load_paste_app("neutron")
from neutron.openstack.common import log as logging from neutron.common import config logging.setup('neutron') config.parse([ '--config-file', '/etc/neutron/neutron.conf', '--config-file', '/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini' ]) application = config.load_paste_app("neutron")
def __init__(self): super(MonitorNeutronAgentsDaemon, self).__init__() logging.setup('Neutron-HA-Monitor') LOG.info('Monitor Neutron Agent Loop Init') self.hostname = None self.env = {}
LOG.error('Restart service: %s' % s) subprocess.check_output(restart) if s == 'neutron-metadata-agent': subprocess.check_output(['sudo', 'service', 'neutron-vpn-agent', 'restart']) def run(self): while True: LOG.info('Monitor Neutron HA Agent Loop Start') quantum = self.get_quantum_client() self.reassign_agent_resources(quantum=quantum) self.check_ovs_tunnel(quantum=quantum) self.check_local_agents() LOG.info('sleep %s' % cfg.CONF.check_interval) time.sleep(float(cfg.CONF.check_interval)) if __name__ == '__main__': opts = [ cfg.StrOpt('check_interval', default=8, help='Check Neutron Agents interval.'), ] cfg.CONF.register_cli_opts(opts) cfg.CONF(project='monitor_neutron_agents', default_config_files=[]) logging.setup('Neutron-HA-Monitor') monitor_daemon = MonitorNeutronAgentsDaemon() monitor_daemon.start()
import logging as py_logging from neutron.openstack.common import log as logging logging.setup("swtich") # TODO(morgbara) figure out how to use a config file for this LOG = logging.getLogger('ironic_neutron_plugin.drivers.cisco.driver') LOG.logger.setLevel(py_logging.DEBUG) from ironic_neutron_plugin.drivers import base from ironic_neutron_plugin.drivers.cisco import driver as cisco_driver def create_port(port, driver): driver.create(port) def delete_port(port, driver): driver.delete(port) def add_vlan(port, driver): driver.attach(port) def remove_vlan(port, driver): driver.detach(port) def show(port, driver): driver.show(port)