l3_db.L3_NAT_db_mixin):
def __init__(self, configfile=None):
- LOG.debug("Start initializing metaplugin")
+ LOG.debug(_("Start initializing metaplugin"))
options = {"sql_connection": cfg.CONF.DATABASE.sql_connection}
options.update({'base': models_v2.model_base.BASEV2})
sql_max_retries = cfg.CONF.DATABASE.sql_max_retries
self.default_flavor = cfg.CONF.META.default_flavor
if not self.default_flavor in self.plugins:
- raise exc.Invalid('default_flavor %s is not plugin list' %
+ raise exc.Invalid(_('default_flavor %s is not plugin list') %
self.default_flavor)
self.default_l3_flavor = cfg.CONF.META.default_l3_flavor
if not self.default_l3_flavor in self.l3_plugins:
- raise exc.Invalid('default_l3_flavor %s is not plugin list' %
+ raise exc.Invalid(_('default_l3_flavor %s is not plugin list') %
self.default_l3_flavor)
db.configure_db(options)
self.default_flavor = cfg.CONF.META.default_flavor
def _load_plugin(self, plugin_provider):
- LOG.debug("Plugin location:%s", plugin_provider)
+ LOG.debug(_("Plugin location: %s"), plugin_provider)
plugin_klass = importutils.import_class(plugin_provider)
return plugin_klass()
if not self._is_l3_plugin(plugin):
self._process_l3_create(context, network['network'], net['id'])
self._extend_network_dict_l3(context, net)
- LOG.debug("Created network: %s with flavor %s " % (net['id'],
- flavor))
+ LOG.debug(_("Created network: %(net_id)s with flavor "
+ "%(flavor)s"), {'net_id': net['id'], 'flavor': flavor})
try:
meta_db_v2.add_network_flavor_binding(context.session,
flavor, str(net['id']))
except:
- LOG.exception('failed to add flavor bindings')
+ LOG.exception(_('Failed to add flavor bindings'))
plugin.delete_network(context, net['id'])
raise FaildToAddFlavorBinding()
- LOG.debug("Created network: %s" % net['id'])
+ LOG.debug(_("Created network: %s"), net['id'])
self._extend_network_dict(context, net)
return net
plugin = self._get_l3_plugin(flavor)
with context.session.begin(subtransactions=True):
r_in_db = plugin.create_router(context, router)
- LOG.debug("Created router: %s with flavor %s " % (r_in_db['id'],
- flavor))
+ LOG.debug(_("Created router: %(router_id)s with flavor "
+ "%(flavor)s"),
+ {'router_id': r_in_db['id'], 'flavor': flavor})
meta_db_v2.add_router_flavor_binding(context.session,
flavor, str(r_in_db['id']))
- LOG.debug("Created router: %s" % r_in_db['id'])
+ LOG.debug(_("Created router: %s"), r_in_db['id'])
self._extend_router_dict(context, r_in_db)
return r_in_db
try:
self._get_client().update_subnet(id, subnet)
except Exception as e:
- LOG.error("update subnet failed: %e" % e)
+ LOG.error(_("Update subnet failed: %s"), e)
return subnet_in_db
def delete_subnet(self, context, id):
try:
self._get_client().delete_subnet(id)
except exceptions.NotFound:
- LOG.warn("subnet in remote have already deleted")
+ LOG.warn(_("Subnet in remote have already deleted"))
return super(ProxyPluginV2, self).delete_subnet(context, id)
def create_network(self, context, network):
try:
self._get_client().update_network(id, network)
except Exception as e:
- LOG.error("update network failed: %e" % e)
+ LOG.error(_("Update network failed: %s"), e)
return network_in_db
def delete_network(self, context, id):
try:
self._get_client().delete_network(id)
except exceptions.NetworkNotFoundClient:
- LOG.warn("network in remote have already deleted")
+ LOG.warn(_("Network in remote have already deleted"))
return super(ProxyPluginV2, self).delete_network(context, id)
def create_port(self, context, port):
try:
self._get_client().update_port(id, port)
except Exception as e:
- LOG.error("update port failed: %e" % e)
+ LOG.error(_("Update port failed: %s"), e)
return port_in_db
def delete_port(self, context, id, l3_port_check=True):
try:
self._get_client().delete_port(id)
except exceptions.PortNotFoundClient:
- LOG.warn("port in remote have already deleted")
+ LOG.warn(_("Port in remote have already deleted"))
return super(ProxyPluginV2, self).delete_port(context, id)