diff options
| author | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2012-05-01 05:15:27 +0000 |
|---|---|---|
| committer | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2012-05-01 05:15:27 +0000 |
| commit | e3515dfe75cd980b7649b059eaa27c4871b6ddfd (patch) | |
| tree | 38152203120ec36706b1412b3002c98feb81dfc8 | |
| parent | fb58a57af6c9e88cc1696378fbd4bb72307bcbcb (diff) | |
| download | nova-e3515dfe75cd980b7649b059eaa27c4871b6ddfd.tar.gz nova-e3515dfe75cd980b7649b059eaa27c4871b6ddfd.tar.xz nova-e3515dfe75cd980b7649b059eaa27c4871b6ddfd.zip | |
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
| -rw-r--r-- | nova/virt/xenapi/vm_utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
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), |
