summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
Diffstat (limited to 'nova')
-rw-r--r--nova/api/ec2/admin.py2
-rw-r--r--nova/objectstore/handler.py5
-rw-r--r--nova/tests/test_rpc.py3
-rw-r--r--nova/virt/hyperv.py4
-rw-r--r--nova/virt/xenapi/vm_utils.py16
-rw-r--r--nova/virt/xenapi/volumeops.py2
6 files changed, 17 insertions, 15 deletions
diff --git a/nova/api/ec2/admin.py b/nova/api/ec2/admin.py
index 377287143..78ff1b3e0 100644
--- a/nova/api/ec2/admin.py
+++ b/nova/api/ec2/admin.py
@@ -162,7 +162,7 @@ class AdminController(object):
member_users=None, **kwargs):
"""Creates a new project"""
msg = _("Create project %(name)s managed by"
- " %(manager_user(s") % locals()
+ " %(manager_user)s") % locals()
LOG.audit(msg, context=context)
return project_dict(
manager.AuthManager().create_project(
diff --git a/nova/objectstore/handler.py b/nova/objectstore/handler.py
index 7031d2361..f49dd5a25 100644
--- a/nova/objectstore/handler.py
+++ b/nova/objectstore/handler.py
@@ -319,9 +319,8 @@ class ObjectResource(ErrorHandlingResource):
context=request.context)
if not self.bucket.is_authorized(request.context):
- LOG.audit("Unauthorized attempt to delete object %s from "
- "bucket %s", self.name, self.bucket.name,
- context=request.context)
+ LOG.audit(_("Unauthorized attempt to delete object %(nm)s from "
+ "bucket %(bname)s") % locals(), context=request.context)
raise exception.NotAuthorized()
del self.bucket[urllib.unquote(self.name)]
diff --git a/nova/tests/test_rpc.py b/nova/tests/test_rpc.py
index 9b0b7b145..4820e04fb 100644
--- a/nova/tests/test_rpc.py
+++ b/nova/tests/test_rpc.py
@@ -86,7 +86,8 @@ class RpcTestCase(test.TestCase):
@staticmethod
def echo(context, queue, value):
"""Calls echo in the passed queue"""
- LOG.debug(_("Nested received %(queue)s, %(value)s") % locals())
+ LOG.debug(_("Nested received %(queue)s, %(value)s")
+ % locals())
ret = rpc.call(context,
queue,
{"method": "echo",
diff --git a/nova/virt/hyperv.py b/nova/virt/hyperv.py
index d3c3afcb7..5facb7aff 100644
--- a/nova/virt/hyperv.py
+++ b/nova/virt/hyperv.py
@@ -199,8 +199,8 @@ class HyperVConnection(object):
def _create_disk(self, vm_name, vhdfile):
"""Create a disk and attach it to the vm"""
- LOG.debug(_('Creating disk for %s by attaching disk file %s'),
- vm_name, vhdfile)
+ LOG.debug(_('Creating disk for %(vm_name)s by attaching'
+ ' disk file %(vhdfile)s') % locals())
#Find the IDE controller for the vm.
vms = self._conn.MSVM_ComputerSystem(ElementName=vm_name)
vm = vms[0]
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index 4988aef3f..65de8e361 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -232,8 +232,9 @@ class VMHelper(HelperBase):
'other_config': {},
'sm_config': {},
'tags': []})
- LOG.debug(_('Created VDI %s (%s, %s, %s) on %s.'), vdi_ref,
- name_label, virtual_size, read_only, sr_ref)
+ LOG.debug(_('Created VDI %(vdi_ref)s (%(name_label)s,'
+ ' %(virtual_size)s, %(read_only)s) on %(sr_ref)s.')
+ % locals())
return vdi_ref
@classmethod
@@ -312,7 +313,7 @@ class VMHelper(HelperBase):
meta, image_file = c.get_image(image)
virtual_size = int(meta['size'])
vdi_size = virtual_size
- LOG.debug(_("Size for image %s:%d"), image, virtual_size)
+ LOG.debug(_("Size for image %(image)s:%(virtual_size)d") % locals())
if type == ImageType.DISK:
# Make room for MBR.
vdi_size += MBR_SIZE_BYTES
@@ -501,7 +502,8 @@ def get_vhd_parent(session, vdi_rec):
parent_uuid = vdi_rec['sm_config']['vhd-parent']
parent_ref = session.get_xenapi().VDI.get_by_uuid(parent_uuid)
parent_rec = session.get_xenapi().VDI.get_record(parent_ref)
- LOG.debug(_("VHD %s has parent %s"), vdi_rec['uuid'], parent_ref)
+ vdi_uuid = vdi_rec['uuid']
+ LOG.debug(_("VHD %(vdi_uuid)s has parent %(parent_ref)s") % locals())
return parent_ref, parent_rec
else:
return None
@@ -571,7 +573,7 @@ def get_vdi_for_vm_safely(session, vm_ref):
num_vdis = len(vdi_refs)
if num_vdis != 1:
raise Exception(_("Unexpected number of VDIs (%(num_vdis)s) found"
- " for VM %s") % locals())
+ " for VM %(vm_ref)s") % locals())
vdi_ref = vdi_refs[0]
vdi_rec = session.get_xenapi().VDI.get_record(vdi_ref)
@@ -683,8 +685,8 @@ def _write_partition(virtual_size, dev):
primary_first = MBR_SIZE_SECTORS
primary_last = MBR_SIZE_SECTORS + (virtual_size / SECTOR_SIZE) - 1
- LOG.debug(_('Writing partition table %d %d to %s...'),
- primary_first, primary_last, dest)
+ LOG.debug(_('Writing partition table %(primary_first)d %(primary_last)d'
+ ' to %(dest)s...') % locals())
def execute(cmd, process_input=None, check_exit_code=True):
return utils.execute(cmd=cmd,
diff --git a/nova/virt/xenapi/volumeops.py b/nova/virt/xenapi/volumeops.py
index 24862c086..d89a6f995 100644
--- a/nova/virt/xenapi/volumeops.py
+++ b/nova/virt/xenapi/volumeops.py
@@ -101,7 +101,7 @@ class VolumeOps(object):
raise exception.NotFound(_('Instance %s not found')
% instance_name)
# Detach VBD from VM
- LOG.debug(_("Detach_volume: %instance_name)s, %(mountpoint)s")
+ LOG.debug(_("Detach_volume: %(instance_name)s, %(mountpoint)s")
% locals())
device_number = VolumeHelper.mountpoint_to_number(mountpoint)
try: