Merge "Remove log translations"
This commit is contained in:
commit
2d1db850e2
|
@ -65,8 +65,6 @@ from oslo_utils import excutils
|
||||||
from nova.virt import firewall
|
from nova.virt import firewall
|
||||||
|
|
||||||
_ = i18n._
|
_ = i18n._
|
||||||
_LW = i18n._LW
|
|
||||||
_LE = i18n._LE
|
|
||||||
|
|
||||||
lxd_opts = [
|
lxd_opts = [
|
||||||
cfg.StrOpt('root_dir',
|
cfg.StrOpt('root_dir',
|
||||||
|
@ -94,8 +92,8 @@ BASE_DIR = os.path.join(
|
||||||
|
|
||||||
|
|
||||||
def _neutron_failed_callback(event_name, instance):
|
def _neutron_failed_callback(event_name, instance):
|
||||||
LOG.error(_LE('Neutron Reported failure on event '
|
LOG.error('Neutron Reported failure on event '
|
||||||
'%(event)s for instance %(uuid)s'),
|
'%(event)s for instance %(uuid)s',
|
||||||
{'event': event_name, 'uuid': instance.name},
|
{'event': event_name, 'uuid': instance.name},
|
||||||
instance=instance)
|
instance=instance)
|
||||||
if CONF.vif_plugging_is_fatal:
|
if CONF.vif_plugging_is_fatal:
|
||||||
|
@ -365,8 +363,8 @@ class LXDDriver(driver.ComputeDriver):
|
||||||
error_callback=_neutron_failed_callback):
|
error_callback=_neutron_failed_callback):
|
||||||
self.plug_vifs(instance, network_info)
|
self.plug_vifs(instance, network_info)
|
||||||
except eventlet.timeout.Timeout:
|
except eventlet.timeout.Timeout:
|
||||||
LOG.warn(_LW('Timeout waiting for vif plugging callback for '
|
LOG.warn('Timeout waiting for vif plugging callback for '
|
||||||
'instance %(uuid)s'), {'uuid': instance['name']})
|
'instance %(uuid)s', {'uuid': instance['name']})
|
||||||
if CONF.vif_plugging_is_fatal:
|
if CONF.vif_plugging_is_fatal:
|
||||||
self.destroy(
|
self.destroy(
|
||||||
context, instance, network_info, block_device_info)
|
context, instance, network_info, block_device_info)
|
||||||
|
@ -453,8 +451,8 @@ class LXDDriver(driver.ComputeDriver):
|
||||||
container.delete(wait=True)
|
container.delete(wait=True)
|
||||||
except lxd_exceptions.LXDAPIException as e:
|
except lxd_exceptions.LXDAPIException as e:
|
||||||
if e.response.status_code == 404:
|
if e.response.status_code == 404:
|
||||||
LOG.warning(_LW('Failed to delete instance. '
|
LOG.warning('Failed to delete instance. '
|
||||||
'Container does not exist for %(instance)s.'),
|
'Container does not exist for %(instance)s.',
|
||||||
{'instance': instance.name})
|
{'instance': instance.name})
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
@ -489,8 +487,8 @@ class LXDDriver(driver.ComputeDriver):
|
||||||
self.client.profiles.get(instance.name).delete()
|
self.client.profiles.get(instance.name).delete()
|
||||||
except lxd_exceptions.LXDAPIException as e:
|
except lxd_exceptions.LXDAPIException as e:
|
||||||
if e.response.status_code == 404:
|
if e.response.status_code == 404:
|
||||||
LOG.warning(_LW('Failed to delete instance. '
|
LOG.warning('Failed to delete instance. '
|
||||||
'Profile does not exist for %(instance)s.'),
|
'Profile does not exist for %(instance)s.',
|
||||||
{'instance': instance.name})
|
{'instance': instance.name})
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
@ -1027,8 +1025,8 @@ class LXDDriver(driver.ComputeDriver):
|
||||||
cdb.make_drive(iso_path)
|
cdb.make_drive(iso_path)
|
||||||
except processutils.ProcessExecutionError as e:
|
except processutils.ProcessExecutionError as e:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error(_LE('Creating config drive failed with '
|
LOG.error('Creating config drive failed with '
|
||||||
'error: %s'),
|
'error: %s',
|
||||||
e, instance=instance)
|
e, instance=instance)
|
||||||
|
|
||||||
configdrive_dir = os.path.join(
|
configdrive_dir = os.path.join(
|
||||||
|
|
|
@ -27,8 +27,6 @@ from pylxd.deprecated import api
|
||||||
from pylxd.deprecated import exceptions as lxd_exceptions
|
from pylxd.deprecated import exceptions as lxd_exceptions
|
||||||
|
|
||||||
_ = i18n._
|
_ = i18n._
|
||||||
_LE = i18n._LE
|
|
||||||
_LI = i18n._LI
|
|
||||||
|
|
||||||
CONF = nova.conf.CONF
|
CONF = nova.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -54,7 +52,7 @@ class LXDAPISession(object):
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
# notify the compute host that the connection failed
|
# notify the compute host that the connection failed
|
||||||
# via an rpc call
|
# via an rpc call
|
||||||
LOG.exception(_LE('Connection to LXD failed'))
|
LOG.exception('Connection to LXD failed')
|
||||||
payload = dict(ip=CONF.host,
|
payload = dict(ip=CONF.host,
|
||||||
method='_connect',
|
method='_connect',
|
||||||
reason=ex)
|
reason=ex)
|
||||||
|
@ -76,9 +74,9 @@ class LXDAPISession(object):
|
||||||
"""
|
"""
|
||||||
LOG.debug('container_init called for instance', instance=instance)
|
LOG.debug('container_init called for instance', instance=instance)
|
||||||
try:
|
try:
|
||||||
LOG.info(_LI('Creating container %(instance)s with'
|
LOG.info('Creating container %(instance)s with'
|
||||||
' %(image)s'), {'instance': instance.name,
|
' %(image)s', {'instance': instance.name,
|
||||||
'image': instance.image_ref})
|
'image': instance.image_ref})
|
||||||
|
|
||||||
client = self.get_session(host=host)
|
client = self.get_session(host=host)
|
||||||
(state, data) = client.container_init(config)
|
(state, data) = client.container_init(config)
|
||||||
|
@ -90,9 +88,9 @@ class LXDAPISession(object):
|
||||||
msg = data.get('err') or data['metadata']
|
msg = data.get('err') or data['metadata']
|
||||||
raise exception.NovaException(msg)
|
raise exception.NovaException(msg)
|
||||||
|
|
||||||
LOG.info(_LI('Successfully created container %(instance)s with'
|
LOG.info('Successfully created container %(instance)s with'
|
||||||
' %(image)s'), {'instance': instance.name,
|
' %(image)s', {'instance': instance.name,
|
||||||
'image': instance.image_ref})
|
'image': instance.image_ref})
|
||||||
except lxd_exceptions.APIError as ex:
|
except lxd_exceptions.APIError as ex:
|
||||||
msg = _('Failed to communicate with LXD API %(instance)s:'
|
msg = _('Failed to communicate with LXD API %(instance)s:'
|
||||||
' %(reason)s') % {'instance': instance.name,
|
' %(reason)s') % {'instance': instance.name,
|
||||||
|
@ -101,7 +99,7 @@ class LXDAPISession(object):
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error(
|
LOG.error(
|
||||||
_LE('Failed to create container %(instance)s: %(reason)s'),
|
'Failed to create container %(instance)s: %(reason)s',
|
||||||
{'instance': instance.name,
|
{'instance': instance.name,
|
||||||
'reason': ex}, instance=instance)
|
'reason': ex}, instance=instance)
|
||||||
|
|
||||||
|
@ -129,8 +127,8 @@ class LXDAPISession(object):
|
||||||
raise exception.NovaException(msg)
|
raise exception.NovaException(msg)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error(_LE('Error from LXD during operation wait'
|
LOG.error('Error from LXD during operation wait'
|
||||||
'%(instance)s: %(reason)s'),
|
'%(instance)s: %(reason)s',
|
||||||
{'instance': instance.image_ref, 'reason': e},
|
{'instance': instance.image_ref, 'reason': e},
|
||||||
instance=instance)
|
instance=instance)
|
||||||
|
|
||||||
|
@ -147,8 +145,8 @@ class LXDAPISession(object):
|
||||||
raise exception.NovaException(msg)
|
raise exception.NovaException(msg)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error(_LE('Error from LXD during operation_info '
|
LOG.error('Error from LXD during operation_info '
|
||||||
'%(instance)s: %(reason)s'),
|
'%(instance)s: %(reason)s',
|
||||||
{'instance': instance.image_ref, 'reason': e},
|
{'instance': instance.image_ref, 'reason': e},
|
||||||
instance=instance)
|
instance=instance)
|
||||||
|
|
||||||
|
@ -166,15 +164,15 @@ class LXDAPISession(object):
|
||||||
"""
|
"""
|
||||||
LOG.debug('container_migrate called for instance', instance=instance)
|
LOG.debug('container_migrate called for instance', instance=instance)
|
||||||
try:
|
try:
|
||||||
LOG.info(_LI('Migrating instance %(instance)s with '
|
LOG.info('Migrating instance %(instance)s with '
|
||||||
'%(image)s'), {'instance': instance_name,
|
'%(image)s', {'instance': instance_name,
|
||||||
'image': instance.image_ref})
|
'image': instance.image_ref})
|
||||||
|
|
||||||
client = self.get_session()
|
client = self.get_session()
|
||||||
(state, data) = client.container_migrate(instance_name)
|
(state, data) = client.container_migrate(instance_name)
|
||||||
|
|
||||||
LOG.info(_LI('Successfully initialized migration for instance '
|
LOG.info('Successfully initialized migration for instance '
|
||||||
'%(instance)s with %(image)s'),
|
'%(instance)s with %(image)s',
|
||||||
{'instance': instance.name,
|
{'instance': instance.name,
|
||||||
'image': instance.image_ref})
|
'image': instance.image_ref})
|
||||||
return (state, data)
|
return (state, data)
|
||||||
|
@ -186,6 +184,6 @@ class LXDAPISession(object):
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error(
|
LOG.error(
|
||||||
_LE('Failed to migrate container %(instance)s: %('
|
'Failed to migrate container %(instance)s: %('
|
||||||
'reason)s'), {'instance': instance.name,
|
'reason)s', {'instance': instance.name,
|
||||||
'reason': ex}, instance=instance)
|
'reason': ex}, instance=instance)
|
||||||
|
|
Loading…
Reference in New Issue