From: Romil Gupta Date: Thu, 13 Nov 2014 13:42:55 +0000 (-0800) Subject: Update i18n translation for openvswitch log msg's X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2f8ec46314ea414c0594d3f2102a1bcc3524f3de;p=openstack-build%2Fneutron-build.git Update i18n translation for openvswitch log msg's This patch set covers the openvswitch directory under neutron/plugins. Partial-Bug: #1320867 Change-Id: I8a80ca6e45a32bd2945ddf4401f6820d99c93c28 --- diff --git a/neutron/hacking/checks.py b/neutron/hacking/checks.py index 7b83b402d..63d85253d 100644 --- a/neutron/hacking/checks.py +++ b/neutron/hacking/checks.py @@ -58,7 +58,8 @@ def _directory_to_check_translation(filename): "neutron/scheduler", "neutron/server", "neutron/services", - "neutron/plugins/ml2"] + "neutron/plugins/ml2", + "neutron/plugins/openvswitch"] return any([dir in filename for dir in dirs]) diff --git a/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py b/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py index 90f5f64e4..3dfa020fa 100644 --- a/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py +++ b/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py @@ -20,7 +20,7 @@ from neutron.api.rpc.handlers import dvr_rpc from neutron.common import constants as n_const from neutron.common import utils as n_utils from neutron.openstack.common import excutils -from neutron.openstack.common.gettextutils import _LE, _LW, _LI +from neutron.openstack.common.gettextutils import _LE, _LI, _LW from neutron.openstack.common import log as logging from neutron.plugins.openvswitch.common import constants @@ -326,16 +326,16 @@ class OVSDVRNeutronAgent(dvr_rpc.DVRAgentRpcApiMixin): ldm = self.local_dvr_map[subnet_uuid] csnat_ofport = ldm.get_csnat_ofport() if csnat_ofport == constants.OFPORT_INVALID: - LOG.error(_("DVR: Duplicate DVR router interface detected " - "for subnet %s"), subnet_uuid) + LOG.error(_LE("DVR: Duplicate DVR router interface detected " + "for subnet %s"), subnet_uuid) return else: # set up LocalDVRSubnetMapping available for this subnet subnet_info = self.plugin_rpc.get_subnet_for_dvr(self.context, subnet_uuid) if not subnet_info: - LOG.error(_("DVR: Unable to retrieve subnet information" - " for subnet_id %s"), subnet_uuid) + LOG.error(_LE("DVR: Unable to retrieve subnet information " + "for subnet_id %s"), subnet_uuid) return LOG.debug("get_subnet_for_dvr for subnet %s returned with %s" % (subnet_uuid, subnet_info)) @@ -493,9 +493,9 @@ class OVSDVRNeutronAgent(dvr_rpc.DVRAgentRpcApiMixin): # dvr routed subnet ovsport = self.local_ports[port.vif_id] subs = list(ovsport.get_subnets()) - LOG.error(_("Centralized-SNAT port %s already seen on "), + LOG.error(_LE("Centralized-SNAT port %s already seen on "), port.vif_id) - LOG.error(_("a different subnet %s"), subs[0]) + LOG.error(_LE("a different subnet %s"), subs[0]) return # since centralized-SNAT (CSNAT) port must have only one fixed # IP, directly use fixed_ips[0] diff --git a/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py index 1f6fa043e..34f1ce17d 100644 --- a/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py @@ -44,6 +44,7 @@ from neutron.common import utils as q_utils from neutron import context from neutron.openstack.common import log as logging from neutron.openstack.common import loopingcall +from neutron.openstack.common.gettextutils import _LE, _LI, _LW from neutron.plugins.common import constants as p_const from neutron.plugins.openvswitch.common import constants @@ -273,7 +274,7 @@ class OVSNeutronAgent(n_rpc.RpcCallback, self.use_call = False self.agent_state.pop('start_flag', None) except Exception: - LOG.exception(_("Failed reporting state!")) + LOG.exception(_LE("Failed reporting state!")) def setup_rpc(self): self.agent_id = 'ovs-agent-%s' % cfg.CONF.host @@ -304,15 +305,15 @@ class OVSNeutronAgent(n_rpc.RpcCallback, return network_id def network_delete(self, context, **kwargs): - LOG.debug(_("network_delete received")) + LOG.debug("network_delete received") network_id = kwargs.get('network_id') - LOG.debug(_("Delete %s"), network_id) + LOG.debug("Delete %s", network_id) # The network may not be defined on this agent lvm = self.local_vlan_map.get(network_id) if lvm: self.reclaim_local_vlan(network_id) else: - LOG.debug(_("Network %s not used on agent."), network_id) + LOG.debug("Network %s not used on agent.", network_id) def port_update(self, context, **kwargs): port = kwargs.get('port') @@ -321,10 +322,10 @@ class OVSNeutronAgent(n_rpc.RpcCallback, # they are not used since there is no guarantee the notifications # are processed in the same order as the relevant API requests self.updated_ports.add(port['id']) - LOG.debug(_("port_update message processed for port %s"), port['id']) + LOG.debug("port_update message processed for port %s", port['id']) def tunnel_update(self, context, **kwargs): - LOG.debug(_("tunnel_update received")) + LOG.debug("tunnel_update received") if not self.enable_tunneling: return tunnel_ip = kwargs.get('tunnel_ip') @@ -333,10 +334,11 @@ class OVSNeutronAgent(n_rpc.RpcCallback, return tunnel_type = kwargs.get('tunnel_type') if not tunnel_type: - LOG.error(_("No tunnel_type specified, cannot create tunnels")) + LOG.error(_LE("No tunnel_type specified, cannot create tunnels")) return if tunnel_type not in self.tunnel_types: - LOG.error(_("tunnel_type %s not supported by agent"), tunnel_type) + LOG.error(_LE("tunnel_type %s not supported by agent"), + tunnel_type) return if tunnel_ip == self.local_ip: return @@ -446,7 +448,7 @@ class OVSNeutronAgent(n_rpc.RpcCallback, dl_vlan=local_vid, nw_dst='%s' % ip) else: - LOG.warning(_('Action %s not supported'), action) + LOG.warning(_LW('Action %s not supported'), action) def provision_local_vlan(self, net_uuid, network_type, physical_network, segmentation_id): @@ -467,7 +469,8 @@ class OVSNeutronAgent(n_rpc.RpcCallback, lvid = lvm.vlan else: if not self.available_local_vlans: - LOG.error(_("No local VLAN available for net-id=%s"), net_uuid) + LOG.error(_LE("No local VLAN available for net-id=%s"), + net_uuid) return lvid = self.available_local_vlans.pop() self.local_vlan_map[net_uuid] = LocalVLANMapping(lvid, @@ -475,8 +478,8 @@ class OVSNeutronAgent(n_rpc.RpcCallback, physical_network, segmentation_id) - LOG.info(_("Assigning %(vlan_id)s as local vlan for " - "net-id=%(net_uuid)s"), + LOG.info(_LI("Assigning %(vlan_id)s as local vlan for " + "net-id=%(net_uuid)s"), {'vlan_id': lvid, 'net_uuid': net_uuid}) if network_type in constants.TUNNEL_NETWORK_TYPES: @@ -504,8 +507,8 @@ class OVSNeutronAgent(n_rpc.RpcCallback, (lvid, constants.LEARN_FROM_TUN)) else: - LOG.error(_("Cannot provision %(network_type)s network for " - "net-id=%(net_uuid)s - tunneling disabled"), + LOG.error(_LE("Cannot provision %(network_type)s network for " + "net-id=%(net_uuid)s - tunneling disabled"), {'network_type': network_type, 'net_uuid': net_uuid}) elif network_type == p_const.TYPE_FLAT: @@ -523,9 +526,9 @@ class OVSNeutronAgent(n_rpc.RpcCallback, dl_vlan=0xffff, actions="mod_vlan_vid:%s,normal" % lvid) else: - LOG.error(_("Cannot provision flat network for " - "net-id=%(net_uuid)s - no bridge for " - "physical_network %(physical_network)s"), + LOG.error(_LE("Cannot provision flat network for " + "net-id=%(net_uuid)s - no bridge for " + "physical_network %(physical_network)s"), {'net_uuid': net_uuid, 'physical_network': physical_network}) elif network_type == p_const.TYPE_VLAN: @@ -543,17 +546,17 @@ class OVSNeutronAgent(n_rpc.RpcCallback, dl_vlan=segmentation_id, actions="mod_vlan_vid:%s,normal" % lvid) else: - LOG.error(_("Cannot provision VLAN network for " - "net-id=%(net_uuid)s - no bridge for " - "physical_network %(physical_network)s"), + LOG.error(_LE("Cannot provision VLAN network for " + "net-id=%(net_uuid)s - no bridge for " + "physical_network %(physical_network)s"), {'net_uuid': net_uuid, 'physical_network': physical_network}) elif network_type == p_const.TYPE_LOCAL: # no flows needed for local networks pass else: - LOG.error(_("Cannot provision unknown network type " - "%(network_type)s for net-id=%(net_uuid)s"), + LOG.error(_LE("Cannot provision unknown network type " + "%(network_type)s for net-id=%(net_uuid)s"), {'network_type': network_type, 'net_uuid': net_uuid}) @@ -566,12 +569,12 @@ class OVSNeutronAgent(n_rpc.RpcCallback, ''' lvm = self.local_vlan_map.pop(net_uuid, None) if lvm is None: - LOG.debug(_("Network %s not used on agent."), net_uuid) + LOG.debug("Network %s not used on agent.", net_uuid) return - LOG.info(_("Reclaiming vlan = %(vlan_id)s from net-id = %(net_uuid)s"), - {'vlan_id': lvm.vlan, - 'net_uuid': net_uuid}) + LOG.info(_LI("Reclaiming vlan = %(vlan_id)s from " + "net-id = %(net_uuid)s"), + {'vlan_id': lvm.vlan, 'net_uuid': net_uuid}) if lvm.network_type in constants.TUNNEL_NETWORK_TYPES: if self.enable_tunneling: @@ -610,8 +613,8 @@ class OVSNeutronAgent(n_rpc.RpcCallback, # no flows needed for local networks pass else: - LOG.error(_("Cannot reclaim unknown network type " - "%(network_type)s for net-id=%(net_uuid)s"), + LOG.error(_LE("Cannot reclaim unknown network type " + "%(network_type)s for net-id=%(net_uuid)s"), {'network_type': lvm.network_type, 'net_uuid': net_uuid}) @@ -664,7 +667,7 @@ class OVSNeutronAgent(n_rpc.RpcCallback, net_uuid = self.get_net_uuid(vif_id) if not self.local_vlan_map.get(net_uuid): - LOG.info(_('port_unbound(): net_uuid %s not in local_vlan_map'), + LOG.info(_LI('port_unbound(): net_uuid %s not in local_vlan_map'), net_uuid) return @@ -737,7 +740,7 @@ class OVSNeutronAgent(n_rpc.RpcCallback, ancillary_bridges = [] for bridge in ovs_bridges: br = ovs_lib.OVSBridge(bridge, self.root_helper) - LOG.info(_('Adding %s to list of bridges.'), bridge) + LOG.info(_LI('Adding %s to list of bridges.'), bridge) ancillary_bridges.append(br) return ancillary_bridges @@ -758,10 +761,10 @@ class OVSNeutronAgent(n_rpc.RpcCallback, self.patch_int_ofport = self.tun_br.add_patch_port( cfg.CONF.OVS.tun_peer_patch_port, cfg.CONF.OVS.int_peer_patch_port) 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. " - "Agent terminated!")) + LOG.error(_LE("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. Agent terminated!")) exit(1) self.tun_br.remove_all_flows() @@ -857,9 +860,9 @@ class OVSNeutronAgent(n_rpc.RpcCallback, new_name = ('%(prefix)s%(truncated)s%(hash)s' % {'prefix': prefix, 'truncated': name[0:namelen], 'hash': hashlib.sha1(name).hexdigest()[0:hashlen]}) - LOG.warning(_("Creating an interface named %(name)s exceeds the " - "%(limit)d character limitation. It was shortened to " - "%(new_name)s to fit."), + LOG.warning(_LW("Creating an interface named %(name)s exceeds the " + "%(limit)d character limitation. It was shortened to " + "%(new_name)s to fit."), {'name': name, 'limit': q_const.DEVICE_NAME_MAX_LEN, 'new_name': new_name}) return new_name @@ -878,15 +881,15 @@ class OVSNeutronAgent(n_rpc.RpcCallback, ip_wrapper = ip_lib.IPWrapper(self.root_helper) ovs_bridges = ovs_lib.get_bridges(self.root_helper) for physical_network, bridge in bridge_mappings.iteritems(): - LOG.info(_("Mapping physical network %(physical_network)s to " - "bridge %(bridge)s"), + LOG.info(_LI("Mapping physical network %(physical_network)s to " + "bridge %(bridge)s"), {'physical_network': physical_network, 'bridge': bridge}) # setup physical bridge if bridge not in ovs_bridges: - LOG.error(_("Bridge %(bridge)s for physical network " - "%(physical_network)s does not exist. Agent " - "terminated!"), + LOG.error(_LE("Bridge %(bridge)s for physical network " + "%(physical_network)s does not exist. Agent " + "terminated!"), {'physical_network': physical_network, 'bridge': bridge}) sys.exit(1) @@ -988,7 +991,7 @@ class OVSNeutronAgent(n_rpc.RpcCallback, and port_tags[lvm.vif_ports[port].port_name] != lvm.vlan ): LOG.info( - _("Port '%(port_name)s' has lost " + _LI("Port '%(port_name)s' has lost " "its vlan tag '%(vlan_tag)d'!"), {'port_name': lvm.vif_ports[port].port_name, 'vlan_tag': lvm.vlan} @@ -1017,8 +1020,8 @@ class OVSNeutronAgent(n_rpc.RpcCallback, # for being treated. If that does not happen, it is a potential # error condition of which operators should be aware if not vif_port.ofport: - LOG.warn(_("VIF port: %s has no ofport configured, and might not " - "be able to transmit"), vif_port.vif_id) + LOG.warn(_LW("VIF port: %s has no ofport configured, " + "and might not be able to transmit"), vif_port.vif_id) if vif_port: if admin_state_up: self.port_bound(vif_port, network_id, network_type, @@ -1027,7 +1030,7 @@ class OVSNeutronAgent(n_rpc.RpcCallback, else: self.port_dead(vif_port) else: - LOG.debug(_("No VIF port for port %s defined on agent."), port_id) + LOG.debug("No VIF port for port %s defined on agent.", port_id) def _setup_tunnel_port(self, br, port_name, remote_ip, tunnel_type): ofport = br.add_tunnel_port(port_name, @@ -1040,10 +1043,10 @@ class OVSNeutronAgent(n_rpc.RpcCallback, try: ofport_int = int(ofport) except (TypeError, ValueError): - LOG.exception(_("ofport should have a value that can be " - "interpreted as an integer")) + LOG.exception(_LE("ofport should have a value that can be " + "interpreted as an integer")) if ofport_int < 0: - LOG.error(_("Failed to set-up %(type)s tunnel port to %(ip)s"), + LOG.error(_LE("Failed to set-up %(type)s tunnel port to %(ip)s"), {'type': tunnel_type, 'ip': remote_ip}) return 0 @@ -1108,13 +1111,13 @@ class OVSNeutronAgent(n_rpc.RpcCallback, port = self.int_br.get_vif_port_by_id(device) if not port: # The port disappeared and cannot be processed - LOG.info(_("Port %s was not found on the integration bridge " - "and will therefore not be processed"), device) + LOG.info(_LI("Port %s was not found on the integration bridge " + "and will therefore not be processed"), device) skipped_devices.append(device) continue if 'port_id' in details: - LOG.info(_("Port %(device)s updated. Details: %(details)s"), + LOG.info(_LI("Port %(device)s updated. Details: %(details)s"), {'device': device, 'details': details}) self.treat_vif_port(port, details['port_id'], details['network_id'], @@ -1131,16 +1134,16 @@ class OVSNeutronAgent(n_rpc.RpcCallback, # neutron server from sending network-vif-* events to the nova # API server, thus possibly preventing instance spawn. if details.get('admin_state_up'): - LOG.debug(_("Setting status for %s to UP"), device) + LOG.debug("Setting status for %s to UP", device) self.plugin_rpc.update_device_up( self.context, device, self.agent_id, cfg.CONF.host) else: - LOG.debug(_("Setting status for %s to DOWN"), device) + LOG.debug("Setting status for %s to DOWN", device) self.plugin_rpc.update_device_down( self.context, device, self.agent_id, cfg.CONF.host) - LOG.info(_("Configuration for device %s completed."), device) + LOG.info(_LI("Configuration for device %s completed."), device) else: - LOG.warn(_("Device %s not defined on plugin"), device) + LOG.warn(_LW("Device %s not defined on plugin"), device) if (port and port.ofport != -1): self.port_dead(port) return skipped_devices @@ -1157,7 +1160,7 @@ class OVSNeutronAgent(n_rpc.RpcCallback, for details in devices_details_list: device = details['device'] - LOG.info(_("Ancillary Port %s added"), device) + LOG.info(_LI("Ancillary Port %s added"), device) # update plugin about port status self.plugin_rpc.update_device_up(self.context, @@ -1169,14 +1172,14 @@ class OVSNeutronAgent(n_rpc.RpcCallback, resync = False self.sg_agent.remove_devices_filter(devices) for device in devices: - LOG.info(_("Attachment %s removed"), device) + LOG.info(_LI("Attachment %s removed"), device) try: self.plugin_rpc.update_device_down(self.context, device, self.agent_id, cfg.CONF.host) except Exception as e: - LOG.debug(_("port_removed failed for %(device)s: %(e)s"), + LOG.debug("port_removed failed for %(device)s: %(e)s", {'device': device, 'e': e}) resync = True continue @@ -1186,22 +1189,22 @@ class OVSNeutronAgent(n_rpc.RpcCallback, def treat_ancillary_devices_removed(self, devices): resync = False for device in devices: - LOG.info(_("Attachment %s removed"), device) + LOG.info(_LI("Attachment %s removed"), device) try: details = self.plugin_rpc.update_device_down(self.context, device, self.agent_id, cfg.CONF.host) except Exception as e: - LOG.debug(_("port_removed failed for %(device)s: %(e)s"), + LOG.debug("port_removed failed for %(device)s: %(e)s", {'device': device, 'e': e}) resync = True continue if details['exists']: - LOG.info(_("Port %s updated."), device) + LOG.info(_LI("Port %s updated."), device) # Nothing to do regarding local networking else: - LOG.debug(_("Device %s not defined on plugin"), device) + LOG.debug("Device %s not defined on plugin", device) return resync def process_network_ports(self, port_info, ovs_restarted): @@ -1229,11 +1232,11 @@ class OVSNeutronAgent(n_rpc.RpcCallback, try: skipped_devices = self.treat_devices_added_or_updated( devices_added_updated, ovs_restarted) - LOG.debug(_("process_network_ports - iteration:%(iter_num)d -" - "treat_devices_added_or_updated completed. " - "Skipped %(num_skipped)d devices of " - "%(num_current)d devices currently available. " - "Time elapsed: %(elapsed).3f"), + LOG.debug("process_network_ports - iteration:%(iter_num)d -" + "treat_devices_added_or_updated completed. " + "Skipped %(num_skipped)d devices of " + "%(num_current)d devices currently available. " + "Time elapsed: %(elapsed).3f", {'iter_num': self.iter_num, 'num_skipped': len(skipped_devices), 'num_current': len(port_info['current']), @@ -1245,15 +1248,15 @@ class OVSNeutronAgent(n_rpc.RpcCallback, except DeviceListRetrievalError: # Need to resync as there was an error with server # communication. - LOG.exception(_("process_network_ports - iteration:%d - " - "failure while retrieving port details " - "from server"), self.iter_num) + LOG.exception(_LE("process_network_ports - iteration:%d - " + "failure while retrieving port details " + "from server"), self.iter_num) resync_a = True if 'removed' in port_info: start = time.time() resync_b = self.treat_devices_removed(port_info['removed']) - LOG.debug(_("process_network_ports - iteration:%(iter_num)d -" - "treat_devices_removed completed in %(elapsed).3f"), + LOG.debug("process_network_ports - iteration:%(iter_num)d -" + "treat_devices_removed completed in %(elapsed).3f", {'iter_num': self.iter_num, 'elapsed': time.time() - start}) # If one of the above operations fails => resync with plugin @@ -1266,25 +1269,25 @@ class OVSNeutronAgent(n_rpc.RpcCallback, start = time.time() try: self.treat_ancillary_devices_added(port_info['added']) - LOG.debug(_("process_ancillary_network_ports - iteration: " - "%(iter_num)d - treat_ancillary_devices_added " - "completed in %(elapsed).3f"), + LOG.debug("process_ancillary_network_ports - iteration: " + "%(iter_num)d - treat_ancillary_devices_added " + "completed in %(elapsed).3f", {'iter_num': self.iter_num, 'elapsed': time.time() - start}) except DeviceListRetrievalError: # Need to resync as there was an error with server # communication. - LOG.exception(_("process_ancillary_network_ports - " - "iteration:%d - failure while retrieving " - "port details from server"), self.iter_num) + LOG.exception(_LE("process_ancillary_network_ports - " + "iteration:%d - failure while retrieving " + "port details from server"), self.iter_num) resync_a = True if 'removed' in port_info: start = time.time() resync_b = self.treat_ancillary_devices_removed( port_info['removed']) - LOG.debug(_("process_ancillary_network_ports - iteration: " - "%(iter_num)d - treat_ancillary_devices_removed " - "completed in %(elapsed).3f"), + LOG.debug("process_ancillary_network_ports - iteration: " + "%(iter_num)d - treat_ancillary_devices_removed " + "completed in %(elapsed).3f", {'iter_num': self.iter_num, 'elapsed': time.time() - start}) @@ -1295,8 +1298,8 @@ class OVSNeutronAgent(n_rpc.RpcCallback, try: return '%08x' % netaddr.IPAddress(ip_address, version=4) except Exception: - LOG.warn(_("Unable to create tunnel port. Invalid remote IP: %s"), - ip_address) + LOG.warn(_LW("Unable to create tunnel port. " + "Invalid remote IP: %s"), ip_address) return def tunnel_sync(self): @@ -1324,7 +1327,7 @@ class OVSNeutronAgent(n_rpc.RpcCallback, tunnel['ip_address'], tunnel_type) except Exception as e: - LOG.debug(_("Unable to sync tunnel IP %(local_ip)s: %(e)s"), + LOG.debug("Unable to sync tunnel IP %(local_ip)s: %(e)s", {'local_ip': self.local_ip, 'e': e}) return True return False @@ -1361,10 +1364,10 @@ class OVSNeutronAgent(n_rpc.RpcCallback, 'removed': 0}, 'ancillary': {'added': 0, 'removed': 0}} - LOG.debug(_("Agent rpc_loop - iteration:%d started"), + LOG.debug("Agent rpc_loop - iteration:%d started", self.iter_num) if sync: - LOG.info(_("Agent out of sync with plugin!")) + LOG.info(_LI("Agent out of sync with plugin!")) ports.clear() ancillary_ports.clear() sync = False @@ -1386,16 +1389,16 @@ class OVSNeutronAgent(n_rpc.RpcCallback, self.dvr_agent.setup_dvr_flows_on_integ_tun_br() # Notify the plugin of tunnel IP if self.enable_tunneling and tunnel_sync: - LOG.info(_("Agent tunnel out of sync with plugin!")) + LOG.info(_LI("Agent tunnel out of sync with plugin!")) try: tunnel_sync = self.tunnel_sync() except Exception: - LOG.exception(_("Error while synchronizing tunnels")) + LOG.exception(_LE("Error while synchronizing tunnels")) tunnel_sync = True if self._agent_has_updates(polling_manager) or ovs_restarted: try: - LOG.debug(_("Agent rpc_loop - iteration:%(iter_num)d - " - "starting polling. Elapsed:%(elapsed).3f"), + LOG.debug("Agent rpc_loop - iteration:%(iter_num)d - " + "starting polling. Elapsed:%(elapsed).3f", {'iter_num': self.iter_num, 'elapsed': time.time() - start}) # Save updated ports dict to perform rollback in @@ -1406,9 +1409,9 @@ class OVSNeutronAgent(n_rpc.RpcCallback, self.updated_ports = set() reg_ports = (set() if ovs_restarted else ports) port_info = self.scan_ports(reg_ports, updated_ports_copy) - LOG.debug(_("Agent rpc_loop - iteration:%(iter_num)d - " - "port information retrieved. " - "Elapsed:%(elapsed).3f"), + LOG.debug("Agent rpc_loop - iteration:%(iter_num)d - " + "port information retrieved. " + "Elapsed:%(elapsed).3f", {'iter_num': self.iter_num, 'elapsed': time.time() - start}) # Secure and wire/unwire VIFs and update their status @@ -1416,13 +1419,13 @@ class OVSNeutronAgent(n_rpc.RpcCallback, if (self._port_info_has_changes(port_info) or self.sg_agent.firewall_refresh_needed() or ovs_restarted): - LOG.debug(_("Starting to process devices in:%s"), + LOG.debug("Starting to process devices in:%s", port_info) # If treat devices fails - must resync with plugin sync = self.process_network_ports(port_info, ovs_restarted) - LOG.debug(_("Agent rpc_loop - iteration:%(iter_num)d -" - "ports processed. Elapsed:%(elapsed).3f"), + LOG.debug("Agent rpc_loop - iteration:%(iter_num)d -" + "ports processed. Elapsed:%(elapsed).3f", {'iter_num': self.iter_num, 'elapsed': time.time() - start}) port_stats['regular']['added'] = ( @@ -1436,18 +1439,18 @@ class OVSNeutronAgent(n_rpc.RpcCallback, if self.ancillary_brs: port_info = self.update_ancillary_ports( ancillary_ports) - LOG.debug(_("Agent rpc_loop - iteration:%(iter_num)d -" - "ancillary port info retrieved. " - "Elapsed:%(elapsed).3f"), + LOG.debug("Agent rpc_loop - iteration:%(iter_num)d -" + "ancillary port info retrieved. " + "Elapsed:%(elapsed).3f", {'iter_num': self.iter_num, 'elapsed': time.time() - start}) if port_info: rc = self.process_ancillary_network_ports( port_info) - LOG.debug(_("Agent rpc_loop - iteration:" - "%(iter_num)d - ancillary ports " - "processed. Elapsed:%(elapsed).3f"), + LOG.debug("Agent rpc_loop - iteration:" + "%(iter_num)d - ancillary ports " + "processed. Elapsed:%(elapsed).3f", {'iter_num': self.iter_num, 'elapsed': time.time() - start}) ancillary_ports = port_info['current'] @@ -1459,24 +1462,24 @@ class OVSNeutronAgent(n_rpc.RpcCallback, polling_manager.polling_completed() except Exception: - LOG.exception(_("Error while processing VIF ports")) + LOG.exception(_LE("Error while processing VIF ports")) # Put the ports back in self.updated_port self.updated_ports |= updated_ports_copy sync = True # sleep till end of polling interval elapsed = (time.time() - start) - LOG.debug(_("Agent rpc_loop - iteration:%(iter_num)d " - "completed. Processed ports statistics: " - "%(port_stats)s. Elapsed:%(elapsed).3f"), + LOG.debug("Agent rpc_loop - iteration:%(iter_num)d " + "completed. Processed ports statistics: " + "%(port_stats)s. Elapsed:%(elapsed).3f", {'iter_num': self.iter_num, 'port_stats': port_stats, 'elapsed': elapsed}) if (elapsed < self.polling_interval): time.sleep(self.polling_interval - elapsed) else: - LOG.debug(_("Loop iteration exceeded interval " - "(%(polling_interval)s vs. %(elapsed)s)!"), + LOG.debug("Loop iteration exceeded interval " + "(%(polling_interval)s vs. %(elapsed)s)!", {'polling_interval': self.polling_interval, 'elapsed': elapsed}) self.iter_num = self.iter_num + 1 @@ -1546,7 +1549,7 @@ def main(): try: agent_config = create_agent_config_map(cfg.CONF) except ValueError as e: - LOG.error(_('%s Agent terminated!'), e) + LOG.error(_LE('%s Agent terminated!'), e) sys.exit(1) is_xen_compute_host = 'rootwrap-xen-dom0' in agent_config['root_helper'] @@ -1559,7 +1562,7 @@ def main(): signal.signal(signal.SIGTERM, agent._handle_sigterm) # Start everything. - LOG.info(_("Agent initialized successfully, now running... ")) + LOG.info(_LI("Agent initialized successfully, now running... ")) agent.daemon_loop()