summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorjaypipes@gmail.com <>2011-01-20 12:52:02 -0500
committerjaypipes@gmail.com <>2011-01-20 12:52:02 -0500
commit13b4f32d1995a8c50bcf86786b6ee75d49bea701 (patch)
tree746eb0bc123386c81c7ff60028e0d039acc6207b /plugins
parent2be5a31a95f264f26f3beb4aba6b9d947790d4b1 (diff)
downloadnova-13b4f32d1995a8c50bcf86786b6ee75d49bea701.tar.gz
nova-13b4f32d1995a8c50bcf86786b6ee75d49bea701.tar.xz
nova-13b4f32d1995a8c50bcf86786b6ee75d49bea701.zip
i18n's strings that were missed or have been added since initial i18n strings branch.
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py60
1 files changed, 37 insertions, 23 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py b/plugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py
index 8e7a829d5..cc0a196af 100755
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py
@@ -60,7 +60,7 @@ def ignore_failure(func, *args, **kwargs):
try:
return func(*args, **kwargs)
except XenAPI.Failure, e:
- logging.error('Ignoring XenAPI.Failure %s', e)
+ logging.error(_('Ignoring XenAPI.Failure %s'), e)
return None
@@ -78,19 +78,25 @@ def validate_exists(args, key, default=None):
"""
if key in args:
if len(args[key]) == 0:
- raise ArgumentError('Argument %r value %r is too short.' %
- (key, args[key]))
+ raise ArgumentError(_('Argument %(key)s value %(value)s is too '
+ 'short.') %
+ {'key': key,
+ 'value': args[key]})
if not ARGUMENT_PATTERN.match(args[key]):
- raise ArgumentError('Argument %r value %r contains invalid '
- 'characters.' % (key, args[key]))
+ raise ArgumentError(_('Argument %(key)s value %(value)s contains '
+ 'invalid characters.') %
+ {'key': key,
+ 'value': args[key]})
if args[key][0] == '-':
- raise ArgumentError('Argument %r value %r starts with a hyphen.'
- % (key, args[key]))
+ raise ArgumentError(_('Argument %(key)s value %(value)s starts '
+ 'with a hyphen.') %
+ {'key': key,
+ 'value': args[key]})
return args[key]
elif default is not None:
return default
else:
- raise ArgumentError('Argument %s is required.' % key)
+ raise ArgumentError(_('Argument %s is required.') % key)
def validate_bool(args, key, default=None):
@@ -105,8 +111,10 @@ def validate_bool(args, key, default=None):
elif value.lower() == 'false':
return False
else:
- raise ArgumentError("Argument %s may not take value %r. "
- "Valid values are ['true', 'false']." % (key, value))
+ raise ArgumentError(_("Argument %(key)s may not take value %(value)s. "
+ "Valid values are ['true', 'false'].")
+ % {'key': key,
+ 'value': value})
def exists(args, key):
@@ -116,7 +124,7 @@ def exists(args, key):
if key in args:
return args[key]
else:
- raise ArgumentError('Argument %s is required.' % key)
+ raise ArgumentError(_('Argument %s is required.') % key)
def optional(args, key):
@@ -149,8 +157,13 @@ def create_vdi(session, sr_ref, name_label, virtual_size, read_only):
'other_config': {},
'sm_config': {},
'tags': []})
- logging.debug('Created VDI %s (%s, %s, %s) on %s.', vdi_ref, name_label,
- virtual_size, read_only, sr_ref)
+ logging.debug(_('Created VDI %(vdi_ref)s (%(label)s, %(size)s, '
+ '%(read_only)s) on %(sr_ref)s.') %
+ {'vdi_ref': vdi_ref,
+ 'label': name_label,
+ 'size': virtual_size,
+ 'read_only': read_only,
+ 'sr_ref': sr_ref})
return vdi_ref
@@ -169,19 +182,19 @@ def with_vdi_in_dom0(session, vdi, read_only, f):
vbd_rec['qos_algorithm_type'] = ''
vbd_rec['qos_algorithm_params'] = {}
vbd_rec['qos_supported_algorithms'] = []
- logging.debug('Creating VBD for VDI %s ... ', vdi)
+ logging.debug(_('Creating VBD for VDI %s ... '), vdi)
vbd = session.xenapi.VBD.create(vbd_rec)
- logging.debug('Creating VBD for VDI %s done.', vdi)
+ logging.debug(_('Creating VBD for VDI %s done.'), vdi)
try:
- logging.debug('Plugging VBD %s ... ', vbd)
+ logging.debug(_('Plugging VBD %s ... '), vbd)
session.xenapi.VBD.plug(vbd)
- logging.debug('Plugging VBD %s done.', vbd)
+ logging.debug(_('Plugging VBD %s done.'), vbd)
return f(session.xenapi.VBD.get_device(vbd))
finally:
- logging.debug('Destroying VBD for VDI %s ... ', vdi)
+ logging.debug(_('Destroying VBD for VDI %s ... '), vdi)
vbd_unplug_with_retry(session, vbd)
ignore_failure(session.xenapi.VBD.destroy, vbd)
- logging.debug('Destroying VBD for VDI %s done.', vdi)
+ logging.debug(_('Destroying VBD for VDI %s done.'), vdi)
def vbd_unplug_with_retry(session, vbd):
@@ -192,19 +205,20 @@ def vbd_unplug_with_retry(session, vbd):
while True:
try:
session.xenapi.VBD.unplug(vbd)
- logging.debug('VBD.unplug successful first time.')
+ logging.debug(_('VBD.unplug successful first time.'))
return
except XenAPI.Failure, e:
if (len(e.details) > 0 and
e.details[0] == 'DEVICE_DETACH_REJECTED'):
- logging.debug('VBD.unplug rejected: retrying...')
+ logging.debug(_('VBD.unplug rejected: retrying...'))
time.sleep(1)
elif (len(e.details) > 0 and
e.details[0] == 'DEVICE_ALREADY_DETACHED'):
- logging.debug('VBD.unplug successful eventually.')
+ logging.debug(_('VBD.unplug successful eventually.'))
return
else:
- logging.error('Ignoring XenAPI.Failure in VBD.unplug: %s', e)
+ logging.error(_('Ignoring XenAPI.Failure in VBD.unplug: %s'),
+ e)
return