from neutron.extensions import portbindings
from neutron.extensions import securitygroup as ext_sg
from neutron.openstack.common import context
+from neutron.i18n import _LE, _LI
from neutron.openstack.common import log as logging
from neutron.plugins.brocade.db import models as brocade_db
from neutron.plugins.brocade import vlanbm as vbm
agent_id = kwargs.get('agent_id')
device = kwargs.get('device')
- LOG.debug(_("Device %(device)s details requested from %(agent_id)s"),
+ LOG.debug("Device %(device)s details requested from %(agent_id)s",
{'device': device, 'agent_id': agent_id})
port = brocade_db.get_port(rpc_context,
device[len(q_const.TAP_DEVICE_PREFIX):])
else:
entry = {'device': device}
- LOG.debug(_("%s can not be found in database"), device)
+ LOG.debug("%s can not be found in database", device)
return entry
def get_devices_details_list(self, rpc_context, **kwargs):
else:
entry = {'device': device,
'exists': False}
- LOG.debug(_("%s can not be found in database"), device)
+ LOG.debug("%s can not be found in database", device)
return entry
vlan_id)
except Exception:
# Proper formatting
- LOG.exception(_("Brocade NOS driver error"))
- LOG.debug(_("Returning the allocated vlan (%d) to the pool"),
+ LOG.exception(_LE("Brocade NOS driver error"))
+ LOG.debug("Returning the allocated vlan (%d) to the pool",
vlan_id)
self._vlan_bitmap.release_vlan(int(vlan_id))
raise Exception(_("Brocade plugin raised exception, "
brocade_db.create_network(context, net_uuid, vlan_id)
self._process_l3_create(context, net, network['network'])
- LOG.info(_("Allocated vlan (%d) from the pool"), vlan_id)
+ LOG.info(_LI("Allocated vlan (%d) from the pool"), vlan_id)
return net
def delete_network(self, context, net_id):
vlan_id)
except Exception:
# Proper formatting
- LOG.exception(_("Brocade NOS driver error"))
+ LOG.exception(_LE("Brocade NOS driver error"))
raise Exception(_("Brocade plugin raised exception, "
"check logs"))
mac)
except Exception:
# Proper formatting
- LOG.exception(_("Brocade NOS driver error"))
+ LOG.exception(_LE("Brocade NOS driver error"))
raise Exception(_("Brocade plugin raised exception, "
"check logs"))
vlan_id,
mac)
except Exception:
- LOG.exception(_("Brocade NOS driver error"))
+ LOG.exception(_LE("Brocade NOS driver error"))
raise Exception(
_("Brocade plugin raised exception, check logs"))
from ncclient import manager
from oslo.utils import excutils
+from neutron.i18n import _LE
from neutron.openstack.common import log as logging
from neutron.plugins.brocade.nos import nctemplates as template
unknown_host_cb=nos_unknown_host_cb)
except Exception as e:
with excutils.save_and_reraise_exception():
- LOG.error(_("Connect failed to switch: %s"), e)
+ LOG.error(_LE("Connect failed to switch: %s"), e)
- LOG.debug(_("Connect success to host %(host)s:%(ssh_port)d"),
+ LOG.debug("Connect success to host %(host)s:%(ssh_port)d",
dict(host=host, ssh_port=SSH_PORT))
return self.mgr
self.activate_port_profile(mgr, name)
except Exception as ex:
with excutils.save_and_reraise_exception():
- LOG.exception(_("NETCONF error: %s"), ex)
+ LOG.exception(_LE("NETCONF error: %s"), ex)
self.close_session()
def delete_network(self, host, username, password, net_id):
self.delete_vlan_interface(mgr, net_id)
except Exception as ex:
with excutils.save_and_reraise_exception():
- LOG.exception(_("NETCONF error: %s"), ex)
+ LOG.exception(_LE("NETCONF error: %s"), ex)
self.close_session()
def associate_mac_to_network(self, host, username, password,
self.associate_mac_to_port_profile(mgr, name, mac)
except Exception as ex:
with excutils.save_and_reraise_exception():
- LOG.exception(_("NETCONF error: %s"), ex)
+ LOG.exception(_LE("NETCONF error: %s"), ex)
self.close_session()
def dissociate_mac_from_network(self, host, username, password,
self.dissociate_mac_from_port_profile(mgr, name, mac)
except Exception as ex:
with excutils.save_and_reraise_exception():
- LOG.exception(_("NETCONF error: %s"), ex)
+ LOG.exception(_LE("NETCONF error: %s"), ex)
self.close_session()
def create_vlan_interface(self, mgr, vlan_id):