From e3515dfe75cd980b7649b059eaa27c4871b6ddfd Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Tue, 1 May 2012 05:15:27 +0000 Subject: Create name_label local variable for logging message The missing local variable will end up logging an exception instead of the intended message, however the code will continue functioning fine. Traceback (most recent call last): File "/usr/lib/python2.6/logging/__init__.py", line 776, in emit msg = self.format(record) File "/usr/lib/python2.6/logging/__init__.py", line 654, in format return fmt.format(record) File "/home/johannes/openstack/nova/trunk/nova/log.py", line 257, in format return logging.Formatter.format(self, record) File "/usr/lib/python2.6/logging/__init__.py", line 436, in format record.message = record.getMessage() File "/usr/lib/python2.6/logging/__init__.py", line 306, in getMessage msg = msg % self.args KeyError: u'name_label' Change-Id: I80bd91a8df51d5411e63ba6a44f227251baf2ab2 --- nova/virt/xenapi/vm_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nova') diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index 64aca60ac..3002fce5a 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -322,8 +322,9 @@ class VMHelper(xenapi.HelperBase): def create_vdi(cls, session, sr_ref, instance, name_description, virtual_size, read_only=False): """Create a VDI record and returns its reference.""" + name_label = instance['name'] vdi_ref = session.call_xenapi("VDI.create", - {'name_label': instance['name'], + {'name_label': name_label, 'name_description': name_description, 'SR': sr_ref, 'virtual_size': str(virtual_size), -- cgit