handler.setFormatter(formatter)
root_logger.addHandler(handler)
+ LOG.info("Logging enabled!")
def load_paste_app(app_name):
if devices:
mac = utils.get_interface_mac(devices[0].name)
else:
- LOG.error("Unable to obtain MAC of any device for agent_id")
+ LOG.error("Unable to obtain MAC address for unique ID. "
+ "Agent terminated!")
exit(1)
self.agent_id = '%s%s' % ('lb', (mac.replace(":", "")))
LOG.info("RPC agent_id: %s" % self.agent_id)
LOG.debug("physical network %s mapped to physical interface %s" %
(physical_network, physical_interface))
except ValueError as ex:
- LOG.error("Invalid physical interface mapping: \'%s\' - %s" %
+ LOG.error("Invalid physical interface mapping: %s - %s. "
+ "Agent terminated!" %
(mapping, ex))
sys.exit(1)
if self.tenant_network_type not in [constants.TYPE_LOCAL,
constants.TYPE_VLAN,
constants.TYPE_NONE]:
- LOG.error("Invalid tenant_network_type: %s" %
+ LOG.error("Invalid tenant_network_type: %s. "
+ "Service terminated!" %
self.tenant_network_type)
sys.exit(1)
self.agent_rpc = cfg.CONF.AGENT.rpc
int(vlan_min),
int(vlan_max))
except ValueError as ex:
- LOG.error("Invalid network VLAN range: \'%s\' - %s" %
+ LOG.error("Invalid network VLAN range: '%s' - %s. "
+ "Service terminated!" %
(entry, ex))
sys.exit(1)
else:
if int(self.patch_tun_ofport) < 0 or int(self.patch_int_ofport) < 0:
LOG.error("Failed to create OVS patch port. Cannot have tunneling "
"enabled on this agent, since this version of OVS does "
- "not support tunnels or patch ports.")
+ "not support tunnels or patch ports. "
+ "Agent terminated!")
exit(1)
self.tun_br.remove_all_flows()
self.tun_br.add_flow(priority=1, actions="drop")
for physical_network, bridge in bridge_mappings.iteritems():
# setup physical bridge
if not ip_lib.device_exists(bridge, self.root_helper):
- LOG.error("Bridge %s for physical network %s does not exist",
+ LOG.error("Bridge %s for physical network %s does not exist. "
+ "Agent terminated!",
bridge, physical_network)
sys.exit(1)
br = ovs_lib.OVSBridge(bridge, self.root_helper)
enable_tunneling = cfg.CONF.OVS.enable_tunneling
if enable_tunneling and not local_ip:
- LOG.error("Invalid local_ip. (%s)" % repr(local_ip))
+ LOG.error("Invalid local_ip. (%s). "
+ "Agent terminated!" % repr(local_ip))
sys.exit(1)
bridge_mappings = {}
LOG.info("Physical network %s mapped to bridge %s",
physical_network, bridge)
except ValueError as ex:
- LOG.error("Invalid bridge mapping: \'%s\' - %s", mapping, ex)
+ LOG.error("Invalid bridge mapping: %s - %s. "
+ "Agent terminated!", mapping, ex)
sys.exit(1)
plugin = OVSQuantumAgent(integ_br, tun_br, local_ip, bridge_mappings,
reconnect_interval, rpc, enable_tunneling)
# Start everything.
+ LOG.info("Agent initialized successfully, now running... ")
plugin.daemon_loop(db_connection_url)
sys.exit(0)
constants.TYPE_VLAN,
constants.TYPE_GRE,
constants.TYPE_NONE]:
- LOG.error("Invalid tenant_network_type: %s",
+ LOG.error("Invalid tenant_network_type: %s. "
+ "Agent terminated!",
self.tenant_network_type)
sys.exit(1)
self.enable_tunneling = cfg.CONF.OVS.enable_tunneling
self._parse_tunnel_id_ranges()
ovs_db_v2.sync_tunnel_allocations(self.tunnel_id_ranges)
elif self.tenant_network_type == constants.TYPE_GRE:
- LOG.error("Tunneling disabled but tenant_network_type is 'gre'")
+ LOG.error("Tunneling disabled but tenant_network_type is 'gre'. "
+ "Agent terminated!")
sys.exit(1)
self.agent_rpc = cfg.CONF.AGENT.rpc
self.setup_rpc()
int(vlan_min),
int(vlan_max))
except ValueError as ex:
- LOG.error("Invalid network VLAN range: \'%s\' - %s",
+ LOG.error("Invalid network VLAN range: '%s' - %s. "
+ "Agent terminated!",
entry, ex)
sys.exit(1)
else:
tun_min, tun_max = entry.split(':')
self.tunnel_id_ranges.append((int(tun_min), int(tun_max)))
except ValueError as ex:
- LOG.error("Invalid tunnel ID range: \'%s\' - %s", entry, ex)
+ LOG.error("Invalid tunnel ID range: '%s' - %s. "
+ "Agent terminated!", entry, ex)
sys.exit(1)
LOG.info("Tunnel ID ranges: %s", self.tunnel_id_ranges)