Merge lp:~ed-leafe/nova/lp703041 into lp:~hudson-openstack/nova/trunk

Proposed by Ed Leafe
Status: Merged
Approved by: Soren Hansen
Approved revision: 581
Merged at revision: 607
Proposed branch: lp:~ed-leafe/nova/lp703041
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 1614 lines (+340/-281)
35 files modified
bin/nova-api (+1/-1)
bin/nova-dhcpbridge (+3/-3)
doc/ext/nova_todo.py (+3/-2)
nova/api/ec2/__init__.py (+12/-8)
nova/api/ec2/admin.py (+23/-16)
nova/api/ec2/apirequest.py (+4/-2)
nova/api/ec2/cloud.py (+8/-6)
nova/api/openstack/servers.py (+3/-3)
nova/auth/ldapdriver.py (+2/-2)
nova/auth/manager.py (+42/-27)
nova/compute/api.py (+7/-4)
nova/compute/manager.py (+17/-15)
nova/compute/monitor.py (+6/-4)
nova/db/sqlalchemy/api.py (+13/-19)
nova/exception.py (+3/-2)
nova/fakerabbit.py (+6/-5)
nova/network/manager.py (+6/-4)
nova/objectstore/handler.py (+22/-21)
nova/rpc.py (+10/-9)
nova/scheduler/manager.py (+1/-1)
nova/service.py (+2/-2)
nova/tests/test_rpc.py (+2/-1)
nova/utils.py (+5/-3)
nova/virt/hyperv.py (+46/-39)
nova/virt/images.py (+1/-1)
nova/virt/libvirt_conn.py (+14/-12)
nova/virt/xenapi/fake.py (+5/-2)
nova/virt/xenapi/vm_utils.py (+33/-27)
nova/virt/xenapi/vmops.py (+5/-2)
nova/virt/xenapi/volume_utils.py (+9/-9)
nova/virt/xenapi/volumeops.py (+12/-13)
nova/virt/xenapi_conn.py (+4/-9)
nova/volume/api.py (+4/-3)
nova/volume/manager.py (+4/-3)
nova/wsgi.py (+2/-1)
To merge this branch: bzr merge lp:~ed-leafe/nova/lp703041
Reviewer Review Type Date Requested Status
Thierry Carrez (community) Approve
Jay Pipes (community) Approve
Review via email: mp+46823@code.launchpad.net

Description of the change

Localized strings that employ formatting should not use positional arguments, as they prevent the translator from re-ordering the translated text; instead, they should use mappings (i.e., dicts). This change replaces all localized formatted strings that use more than one formatting placeholder with a mapping version.

To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote :

lgtm

review: Approve
Revision history for this message
Thierry Carrez (ttx) wrote :

L195: you want %(controller)s, not %(contorller)s

review: Needs Fixing
Revision history for this message
Ed Leafe (ed-leafe) wrote :

Thierry: good catch. Fixed and pushed.

Revision history for this message
Thierry Carrez (ttx) wrote :

lgtm

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (21.0 KiB)

The attempt to merge lp:~ed-leafe/nova/lp703041 into lp:nova failed. Below is the output from the failed tests.

AdminAPITest
    test_admin_disabled ok
    test_admin_enabled ok
APITest
    test_exceptions_are_converted_to_faults ok
Test
    test_authorize_token ok
    test_authorize_user ok
    test_bad_token ok
    test_bad_user ok
    test_no_user ok
    test_token_expiry ok
TestLimiter
    test_authorize_token ok
TestFaults
    test_fault_parts ok
    test_raise ok
    test_retry_header ok
FlavorsTest
    test_get_flavor_by_id ok
    test_get_flavor_list ok
GlanceImageServiceTest
    test_create ok
    test_create_and_show_non_existing_image ok
    test_delete ok
    test_update ok
ImageControllerWithGlanceServiceTest
    test_get_image_details ok
    test_get_image_index ok
LocalImageServiceTest
    test_create ok
    test_create_and_show_non_existing_image ok
    test_delete ok
    test_update ok
LimiterTest
    test_minute ok
    test_one_per_period ok
    test_second ok
    test_users_get_separate_buckets ok
    test_we_can_go_indefinitely_if_we_spread_out_requests ok
WSGIAppProxyTest
    test_200 ok
    test_403 ok
    test_failure ok
WSGIAppTest
    test_escaping ok
    test_good_urls ok
    test_invalid_methods ok
    test_invalid_urls ok
    test_response_to_delays ok
ServersTest
    test_create_backup_schedules ok
    test_create_instance ok
    test_delete_backup_schedules ok
    test_delete_server_instance ok
    test_get_all_server_details ok
    test_g...

lp:~ed-leafe/nova/lp703041 updated
581. By Ed Leafe

Removed tabs form source. Merged trunk changes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/nova-api'
--- bin/nova-api 2011-01-20 11:26:19 +0000
+++ bin/nova-api 2011-01-24 15:23:08 +0000
@@ -56,7 +56,7 @@
56 if config is None:56 if config is None:
57 LOG.debug(_("No paste configuration for app: %s"), api)57 LOG.debug(_("No paste configuration for app: %s"), api)
58 continue58 continue
59 LOG.debug(_("App Config: %s\n%r"), api, config)59 LOG.debug(_("App Config: %(api)s\n%(config)r") % locals())
60 wsgi.paste_config_to_flags(config, {60 wsgi.paste_config_to_flags(config, {
61 "verbose": FLAGS.verbose,61 "verbose": FLAGS.verbose,
62 "%s_host" % api: config.get('host', '0.0.0.0'),62 "%s_host" % api: config.get('host', '0.0.0.0'),
6363
=== modified file 'bin/nova-dhcpbridge'
--- bin/nova-dhcpbridge 2011-01-04 05:26:41 +0000
+++ bin/nova-dhcpbridge 2011-01-24 15:23:08 +0000
@@ -120,9 +120,9 @@
120 mac = argv[2]120 mac = argv[2]
121 ip = argv[3]121 ip = argv[3]
122 hostname = argv[4]122 hostname = argv[4]
123 LOG.debug(_("Called %s for mac %s with ip %s and "123 msg = _("Called %(action)s for mac %(mac)s with ip %(ip)s and"
124 "hostname %s on interface %s"),124 " hostname %(hostname)s on interface %(interface)s") % locals()
125 action, mac, ip, hostname, interface)125 LOG.debug(msg)
126 globals()[action + '_lease'](mac, ip, hostname, interface)126 globals()[action + '_lease'](mac, ip, hostname, interface)
127 else:127 else:
128 print init_leases(interface)128 print init_leases(interface)
129129
=== modified file 'doc/ext/nova_todo.py'
--- doc/ext/nova_todo.py 2010-11-12 17:25:01 +0000
+++ doc/ext/nova_todo.py 2011-01-24 15:23:08 +0000
@@ -26,7 +26,7 @@
26 # reading through docutils for the proper way to construct an empty list26 # reading through docutils for the proper way to construct an empty list
27 lists = []27 lists = []
28 for i in xrange(5):28 for i in xrange(5):
29 lists.append(nodes.bullet_list("", nodes.Text('','')));29 lists.append(nodes.bullet_list("", nodes.Text('','')))
30 lists[i].remove(lists[i][0]) 30 lists[i].remove(lists[i][0])
31 lists[i].set_class('todo_list')31 lists[i].set_class('todo_list')
3232
@@ -42,7 +42,8 @@
42 # Create a reference42 # Create a reference
43 newnode = nodes.reference('', '')43 newnode = nodes.reference('', '')
4444
45 link = _('%s, line %d') % (filename, todo_info['lineno']);45 line_info = todo_info['lineno']
46 link = _('%(filename)s, line %(line_info)d') % locals()
46 innernode = nodes.emphasis(link, link)47 innernode = nodes.emphasis(link, link)
47 newnode['refdocname'] = todo_info['docname']48 newnode['refdocname'] = todo_info['docname']
4849
4950
=== modified file 'nova/api/ec2/__init__.py'
--- nova/api/ec2/__init__.py 2011-01-12 22:47:43 +0000
+++ nova/api/ec2/__init__.py 2011-01-24 15:23:08 +0000
@@ -131,9 +131,11 @@
131 # NOTE(vish): To use incr, failures has to be a string.131 # NOTE(vish): To use incr, failures has to be a string.
132 self.mc.set(failures_key, '1', time=FLAGS.lockout_window * 60)132 self.mc.set(failures_key, '1', time=FLAGS.lockout_window * 60)
133 elif failures >= FLAGS.lockout_attempts:133 elif failures >= FLAGS.lockout_attempts:
134 LOG.warn(_('Access key %s has had %d failed authentications'134 lock_mins = FLAGS.lockout_minutes
135 ' and will be locked out for %d minutes.'),135 msg = _('Access key %(access_key)s has had %(failures)d'
136 access_key, failures, FLAGS.lockout_minutes)136 ' failed authentications and will be locked out'
137 ' for %(lock_mins)d minutes.') % locals()
138 LOG.warn(msg)
137 self.mc.set(failures_key, str(failures),139 self.mc.set(failures_key, str(failures),
138 time=FLAGS.lockout_minutes * 60)140 time=FLAGS.lockout_minutes * 60)
139 return res141 return res
@@ -179,8 +181,10 @@
179 project=project,181 project=project,
180 remote_address=remote_address)182 remote_address=remote_address)
181 req.environ['ec2.context'] = ctxt183 req.environ['ec2.context'] = ctxt
182 LOG.audit(_('Authenticated Request For %s:%s)'), user.name,184 uname = user.name
183 project.name, context=req.environ['ec2.context'])185 pname = project.name
186 msg = _('Authenticated Request For %(uname)s:%(pname)s)') % locals()
187 LOG.audit(msg, context=req.environ['ec2.context'])
184 return self.application188 return self.application
185189
186190
@@ -206,7 +210,7 @@
206210
207 LOG.debug(_('action: %s'), action)211 LOG.debug(_('action: %s'), action)
208 for key, value in args.items():212 for key, value in args.items():
209 LOG.debug(_('arg: %s\t\tval: %s'), key, value)213 LOG.debug(_('arg: %(key)s\t\tval: %(value)s') % locals())
210214
211 # Success!215 # Success!
212 api_request = apirequest.APIRequest(self.controller, action, args)216 api_request = apirequest.APIRequest(self.controller, action, args)
@@ -277,8 +281,8 @@
277 if self._matches_any_role(context, allowed_roles):281 if self._matches_any_role(context, allowed_roles):
278 return self.application282 return self.application
279 else:283 else:
280 LOG.audit(_("Unauthorized request for controller=%s "284 LOG.audit(_('Unauthorized request for controller=%(controller)s '
281 "and action=%s"), controller, action, context=context)285 'and action=%(action)s') % locals(), context=context)
282 raise webob.exc.HTTPUnauthorized()286 raise webob.exc.HTTPUnauthorized()
283287
284 def _matches_any_role(self, context, roles):288 def _matches_any_role(self, context, roles):
285289
=== modified file 'nova/api/ec2/admin.py'
--- nova/api/ec2/admin.py 2011-01-10 21:06:36 +0000
+++ nova/api/ec2/admin.py 2011-01-24 15:23:08 +0000
@@ -111,19 +111,23 @@
111 """Add or remove a role for a user and project."""111 """Add or remove a role for a user and project."""
112 if operation == 'add':112 if operation == 'add':
113 if project:113 if project:
114 LOG.audit(_("Adding role %s to user %s for project %s"), role,114 msg = _("Adding role %(role)s to user %(user)s"
115 user, project, context=context)115 " for project %(project)s") % locals()
116 LOG.audit(msg, context=context)
116 else:117 else:
117 LOG.audit(_("Adding sitewide role %s to user %s"), role, user,118 msg = _("Adding sitewide role %(role)s to"
118 context=context)119 " user %(user)s") % locals()
120 LOG.audit(msg, context=context)
119 manager.AuthManager().add_role(user, role, project)121 manager.AuthManager().add_role(user, role, project)
120 elif operation == 'remove':122 elif operation == 'remove':
121 if project:123 if project:
122 LOG.audit(_("Removing role %s from user %s for project %s"),124 msg = _("Removing role %(role)s from user %(user)s"
123 role, user, project, context=context)125 " for project %(project)s") % locals()
126 LOG.audit(msg, context=context)
124 else:127 else:
125 LOG.audit(_("Removing sitewide role %s from user %s"), role,128 msg = _("Removing sitewide role %(role)s"
126 user, context=context)129 " from user %(user)s") % locals()
130 LOG.audit(msg, context=context)
127 manager.AuthManager().remove_role(user, role, project)131 manager.AuthManager().remove_role(user, role, project)
128 else:132 else:
129 raise exception.ApiError(_('operation must be add or remove'))133 raise exception.ApiError(_('operation must be add or remove'))
@@ -139,8 +143,9 @@
139 project = name143 project = name
140 project = manager.AuthManager().get_project(project)144 project = manager.AuthManager().get_project(project)
141 user = manager.AuthManager().get_user(name)145 user = manager.AuthManager().get_user(name)
142 LOG.audit(_("Getting x509 for user: %s on project: %s"), name,146 msg = _("Getting x509 for user: %(name)s"
143 project, context=context)147 " on project: %(project)s") % locals()
148 LOG.audit(msg, context=context)
144 return user_dict(user, base64.b64encode(project.get_credentials(user)))149 return user_dict(user, base64.b64encode(project.get_credentials(user)))
145150
146 def describe_project(self, context, name, **kwargs):151 def describe_project(self, context, name, **kwargs):
@@ -156,8 +161,9 @@
156 def register_project(self, context, name, manager_user, description=None,161 def register_project(self, context, name, manager_user, description=None,
157 member_users=None, **kwargs):162 member_users=None, **kwargs):
158 """Creates a new project"""163 """Creates a new project"""
159 LOG.audit(_("Create project %s managed by %s"), name, manager_user,164 msg = _("Create project %(name)s managed by"
160 context=context)165 " %(manager_user)s") % locals()
166 LOG.audit(msg, context=context)
161 return project_dict(167 return project_dict(
162 manager.AuthManager().create_project(168 manager.AuthManager().create_project(
163 name,169 name,
@@ -181,12 +187,13 @@
181 **kwargs):187 **kwargs):
182 """Add or remove a user from a project."""188 """Add or remove a user from a project."""
183 if operation == 'add':189 if operation == 'add':
184 LOG.audit(_("Adding user %s to project %s"), user, project,190 msg = _("Adding user %(user)s to project %(project)s") % locals()
185 context=context)191 LOG.audit(msg, context=context)
186 manager.AuthManager().add_to_project(user, project)192 manager.AuthManager().add_to_project(user, project)
187 elif operation == 'remove':193 elif operation == 'remove':
188 LOG.audit(_("Removing user %s from project %s"), user, project,194 msg = _("Removing user %(user)s from"
189 context=context)195 " project %(project)s") % locals()
196 LOG.audit(msg, context=context)
190 manager.AuthManager().remove_from_project(user, project)197 manager.AuthManager().remove_from_project(user, project)
191 else:198 else:
192 raise exception.ApiError(_('operation must be add or remove'))199 raise exception.ApiError(_('operation must be add or remove'))
193200
=== modified file 'nova/api/ec2/apirequest.py'
--- nova/api/ec2/apirequest.py 2011-01-12 19:20:05 +0000
+++ nova/api/ec2/apirequest.py 2011-01-24 15:23:08 +0000
@@ -93,8 +93,10 @@
93 method = getattr(self.controller,93 method = getattr(self.controller,
94 _camelcase_to_underscore(self.action))94 _camelcase_to_underscore(self.action))
95 except AttributeError:95 except AttributeError:
96 _error = _('Unsupported API request: controller = %s,'96 controller = self.controller
97 'action = %s') % (self.controller, self.action)97 action = self.action
98 _error = _('Unsupported API request: controller = %(controller)s,'
99 ' action = %(action)s') % locals()
98 LOG.exception(_error)100 LOG.exception(_error)
99 # TODO: Raise custom exception, trap in apiserver,101 # TODO: Raise custom exception, trap in apiserver,
100 # and reraise as 400 error.102 # and reraise as 400 error.
101103
=== modified file 'nova/api/ec2/cloud.py'
--- nova/api/ec2/cloud.py 2011-01-20 20:04:57 +0000
+++ nova/api/ec2/cloud.py 2011-01-24 15:23:08 +0000
@@ -601,8 +601,9 @@
601 def attach_volume(self, context, volume_id, instance_id, device, **kwargs):601 def attach_volume(self, context, volume_id, instance_id, device, **kwargs):
602 volume_id = ec2_id_to_id(volume_id)602 volume_id = ec2_id_to_id(volume_id)
603 instance_id = ec2_id_to_id(instance_id)603 instance_id = ec2_id_to_id(instance_id)
604 LOG.audit(_("Attach volume %s to instance %s at %s"), volume_id,604 msg = _("Attach volume %(volume_id)s to instance %(instance_id)s"
605 instance_id, device, context=context)605 " at %(device)s") % locals()
606 LOG.audit(msg, context=context)
606 self.compute_api.attach_volume(context,607 self.compute_api.attach_volume(context,
607 instance_id=instance_id,608 instance_id=instance_id,
608 volume_id=volume_id,609 volume_id=volume_id,
@@ -751,8 +752,8 @@
751 return {'releaseResponse': ["Address released."]}752 return {'releaseResponse': ["Address released."]}
752753
753 def associate_address(self, context, instance_id, public_ip, **kwargs):754 def associate_address(self, context, instance_id, public_ip, **kwargs):
754 LOG.audit(_("Associate address %s to instance %s"), public_ip,755 LOG.audit(_("Associate address %(public_ip)s to"
755 instance_id, context=context)756 " instance %(instance_id)s") % locals(), context=context)
756 instance_id = ec2_id_to_id(instance_id)757 instance_id = ec2_id_to_id(instance_id)
757 self.compute_api.associate_floating_ip(context,758 self.compute_api.associate_floating_ip(context,
758 instance_id=instance_id,759 instance_id=instance_id,
@@ -840,8 +841,9 @@
840 if image_location is None and 'name' in kwargs:841 if image_location is None and 'name' in kwargs:
841 image_location = kwargs['name']842 image_location = kwargs['name']
842 image_id = self.image_service.register(context, image_location)843 image_id = self.image_service.register(context, image_location)
843 LOG.audit(_("Registered image %s with id %s"), image_location,844 msg = _("Registered image %(image_location)s with"
844 image_id, context=context)845 " id %(image_id)s") % locals()
846 LOG.audit(msg, context=context)
845 return {'imageId': image_id}847 return {'imageId': image_id}
846848
847 def describe_image_attribute(self, context, image_id, attribute, **kwargs):849 def describe_image_attribute(self, context, image_id, attribute, **kwargs):
848850
=== modified file 'nova/api/openstack/servers.py'
--- nova/api/openstack/servers.py 2011-01-15 01:48:48 +0000
+++ nova/api/openstack/servers.py 2011-01-24 15:23:08 +0000
@@ -132,9 +132,9 @@
132 if image_id in mapping:132 if image_id in mapping:
133 return mapping[image_id]133 return mapping[image_id]
134134
135 raise exception.NotFound(135 msg = _("No entry for image '%(image_id)s'"
136 _("No entry for image '%s' in mapping file '%s'") %136 " in mapping file '%(mapping_filename)s'") % locals()
137 (image_id, mapping_filename))137 raise exception.NotFound(msg)
138138
139 def create(self, req):139 def create(self, req):
140 """ Creates a new server for a given user """140 """ Creates a new server for a given user """
141141
=== modified file 'nova/auth/ldapdriver.py'
--- nova/auth/ldapdriver.py 2011-01-20 17:52:02 +0000
+++ nova/auth/ldapdriver.py 2011-01-24 15:23:08 +0000
@@ -473,8 +473,8 @@
473 raise exception.NotFound(_("The group at dn %s doesn't exist") %473 raise exception.NotFound(_("The group at dn %s doesn't exist") %
474 group_dn)474 group_dn)
475 if self.__is_in_group(uid, group_dn):475 if self.__is_in_group(uid, group_dn):
476 raise exception.Duplicate(_("User %s is already a member of "476 raise exception.Duplicate(_("User %(uid)s is already a member of "
477 "the group %s") % (uid, group_dn))477 "the group %(group_dn)s") % locals())
478 attr = [(self.ldap.MOD_ADD, 'member', self.__uid_to_dn(uid))]478 attr = [(self.ldap.MOD_ADD, 'member', self.__uid_to_dn(uid))]
479 self.conn.modify_s(group_dn, attr)479 self.conn.modify_s(group_dn, attr)
480480
481481
=== modified file 'nova/auth/manager.py'
--- nova/auth/manager.py 2011-01-13 23:23:18 +0000
+++ nova/auth/manager.py 2011-01-24 15:23:08 +0000
@@ -272,16 +272,22 @@
272272
273 project = self.get_project(project_id)273 project = self.get_project(project_id)
274 if project == None:274 if project == None:
275 LOG.audit(_("failed authorization: no project named %s (user=%s)"),275 pjid = project_id
276 project_id, user.name)276 uname = user.name
277 LOG.audit(_("failed authorization: no project named %(pjid)s"
278 " (user=%(uname)s)") % locals())
277 raise exception.NotFound(_('No project called %s could be found')279 raise exception.NotFound(_('No project called %s could be found')
278 % project_id)280 % project_id)
279 if not self.is_admin(user) and not self.is_project_member(user,281 if not self.is_admin(user) and not self.is_project_member(user,
280 project):282 project):
281 LOG.audit(_("Failed authorization: user %s not admin and not "283 uname = user.name
282 "member of project %s"), user.name, project.name)284 uid = user.id
283 raise exception.NotFound(_('User %s is not a member of project %s')285 pjname = project.name
284 % (user.id, project.id))286 pjid = project.id
287 LOG.audit(_("Failed authorization: user %(uname)s not admin"
288 " and not member of project %(pjname)s") % locals())
289 raise exception.NotFound(_('User %(uid)s is not a member of'
290 ' project %(pjid)s') % locals())
285 if check_type == 's3':291 if check_type == 's3':
286 sign = signer.Signer(user.secret.encode())292 sign = signer.Signer(user.secret.encode())
287 expected_signature = sign.s3_authorization(headers, verb, path)293 expected_signature = sign.s3_authorization(headers, verb, path)
@@ -408,14 +414,16 @@
408 raise exception.NotFound(_("The %s role can not be found") % role)414 raise exception.NotFound(_("The %s role can not be found") % role)
409 if project is not None and role in FLAGS.global_roles:415 if project is not None and role in FLAGS.global_roles:
410 raise exception.NotFound(_("The %s role is global only") % role)416 raise exception.NotFound(_("The %s role is global only") % role)
417 uid = User.safe_id(user)
418 pid = Project.safe_id(project)
411 if project:419 if project:
412 LOG.audit(_("Adding role %s to user %s in project %s"), role,420 LOG.audit(_("Adding role %(role)s to user %(uid)s"
413 User.safe_id(user), Project.safe_id(project))421 " in project %(pid)s") % locals())
414 else:422 else:
415 LOG.audit(_("Adding sitewide role %s to user %s"), role,423 LOG.audit(_("Adding sitewide role %(role)s to user %(uid)s")
416 User.safe_id(user))424 % locals())
417 with self.driver() as drv:425 with self.driver() as drv:
418 drv.add_role(User.safe_id(user), role, Project.safe_id(project))426 drv.add_role(uid, role, pid)
419427
420 def remove_role(self, user, role, project=None):428 def remove_role(self, user, role, project=None):
421 """Removes role for user429 """Removes role for user
@@ -434,14 +442,16 @@
434 @type project: Project or project_id442 @type project: Project or project_id
435 @param project: Project in which to remove local role.443 @param project: Project in which to remove local role.
436 """444 """
445 uid = User.safe_id(user)
446 pid = Project.safe_id(project)
437 if project:447 if project:
438 LOG.audit(_("Removing role %s from user %s on project %s"),448 LOG.audit(_("Removing role %(role)s from user %(uid)s"
439 role, User.safe_id(user), Project.safe_id(project))449 " on project %(pid)s") % locals())
440 else:450 else:
441 LOG.audit(_("Removing sitewide role %s from user %s"), role,451 LOG.audit(_("Removing sitewide role %(role)s"
442 User.safe_id(user))452 " from user %(uid)s") % locals())
443 with self.driver() as drv:453 with self.driver() as drv:
444 drv.remove_role(User.safe_id(user), role, Project.safe_id(project))454 drv.remove_role(uid, role, pid)
445455
446 @staticmethod456 @staticmethod
447 def get_roles(project_roles=True):457 def get_roles(project_roles=True):
@@ -502,8 +512,8 @@
502 description,512 description,
503 member_users)513 member_users)
504 if project_dict:514 if project_dict:
505 LOG.audit(_("Created project %s with manager %s"), name,515 LOG.audit(_("Created project %(name)s with"
506 manager_user)516 " manager %(manager_user)s") % locals())
507 project = Project(**project_dict)517 project = Project(**project_dict)
508 return project518 return project
509519
@@ -530,11 +540,12 @@
530540
531 def add_to_project(self, user, project):541 def add_to_project(self, user, project):
532 """Add user to project"""542 """Add user to project"""
533 LOG.audit(_("Adding user %s to project %s"), User.safe_id(user),543 uid = User.safe_id(user)
534 Project.safe_id(project))544 pid = Project.safe_id(project)
545 LOG.audit(_("Adding user %(uid)s to project %(pid)s") % locals())
535 with self.driver() as drv:546 with self.driver() as drv:
536 return drv.add_to_project(User.safe_id(user),547 return drv.add_to_project(User.safe_id(user),
537 Project.safe_id(project))548 Project.safe_id(project))
538549
539 def is_project_manager(self, user, project):550 def is_project_manager(self, user, project):
540 """Checks if user is project manager"""551 """Checks if user is project manager"""
@@ -550,11 +561,11 @@
550561
551 def remove_from_project(self, user, project):562 def remove_from_project(self, user, project):
552 """Removes a user from a project"""563 """Removes a user from a project"""
553 LOG.audit(_("Remove user %s from project %s"), User.safe_id(user),564 uid = User.safe_id(user)
554 Project.safe_id(project))565 pid = Project.safe_id(project)
566 LOG.audit(_("Remove user %(uid)s from project %(pid)s") % locals())
555 with self.driver() as drv:567 with self.driver() as drv:
556 return drv.remove_from_project(User.safe_id(user),568 return drv.remove_from_project(uid, pid)
557 Project.safe_id(project))
558569
559 @staticmethod570 @staticmethod
560 def get_project_vpn_data(project):571 def get_project_vpn_data(project):
@@ -634,7 +645,10 @@
634 user_dict = drv.create_user(name, access, secret, admin)645 user_dict = drv.create_user(name, access, secret, admin)
635 if user_dict:646 if user_dict:
636 rv = User(**user_dict)647 rv = User(**user_dict)
637 LOG.audit(_("Created user %s (admin: %r)"), rv.name, rv.admin)648 rvname = rv.name
649 rvadmin = rv.admin
650 LOG.audit(_("Created user %(rvname)s"
651 " (admin: %(rvadmin)r)") % locals())
638 return rv652 return rv
639653
640 def delete_user(self, user):654 def delete_user(self, user):
@@ -656,7 +670,8 @@
656 if secret_key:670 if secret_key:
657 LOG.audit(_("Secret Key change for user %s"), uid)671 LOG.audit(_("Secret Key change for user %s"), uid)
658 if admin is not None:672 if admin is not None:
659 LOG.audit(_("Admin status set to %r for user %s"), admin, uid)673 LOG.audit(_("Admin status set to %(admin)r"
674 " for user %(uid)s") % locals())
660 with self.driver() as drv:675 with self.driver() as drv:
661 drv.modify_user(uid, access_key, secret_key, admin)676 drv.modify_user(uid, access_key, secret_key, admin)
662677
663678
=== modified file 'nova/compute/api.py'
--- nova/compute/api.py 2011-01-20 19:33:37 +0000
+++ nova/compute/api.py 2011-01-24 15:23:08 +0000
@@ -92,8 +92,9 @@
92 type_data = instance_types.INSTANCE_TYPES[instance_type]92 type_data = instance_types.INSTANCE_TYPES[instance_type]
93 num_instances = quota.allowed_instances(context, max_count, type_data)93 num_instances = quota.allowed_instances(context, max_count, type_data)
94 if num_instances < min_count:94 if num_instances < min_count:
95 LOG.warn(_("Quota exceeeded for %s, tried to run %s instances"),95 pid = context.project_id
96 context.project_id, min_count)96 LOG.warn(_("Quota exceeeded for %(pid)s,"
97 " tried to run %(min_count)s instances") % locals())
97 raise quota.QuotaError(_("Instance quota exceeded. You can only "98 raise quota.QuotaError(_("Instance quota exceeded. You can only "
98 "run %s more instances of this type.") %99 "run %s more instances of this type.") %
99 num_instances, "InstanceLimitExceeded")100 num_instances, "InstanceLimitExceeded")
@@ -183,8 +184,10 @@
183 instance = self.update(context, instance_id, **updates)184 instance = self.update(context, instance_id, **updates)
184 instances.append(instance)185 instances.append(instance)
185186
186 LOG.debug(_("Casting to scheduler for %s/%s's instance %s"),187 pid = context.project_id
187 context.project_id, context.user_id, instance_id)188 uid = context.user_id
189 LOG.debug(_("Casting to scheduler for %(pid)s/%(uid)s's"
190 " instance %(instance_id)s") % locals())
188 rpc.cast(context,191 rpc.cast(context,
189 FLAGS.scheduler_topic,192 FLAGS.scheduler_topic,
190 {"method": "run_instance",193 {"method": "run_instance",
191194
=== modified file 'nova/compute/manager.py'
--- nova/compute/manager.py 2011-01-18 19:01:16 +0000
+++ nova/compute/manager.py 2011-01-24 15:23:08 +0000
@@ -77,8 +77,8 @@
7777
78 LOG.info(_("check_instance_lock: decorating: |%s|"), function,78 LOG.info(_("check_instance_lock: decorating: |%s|"), function,
79 context=context)79 context=context)
80 LOG.info(_("check_instance_lock: arguments: |%s| |%s| |%s|"),80 LOG.info(_("check_instance_lock: arguments: |%(self)s| |%(context)s|"
81 self, context, instance_id, context=context)81 " |%(instance_id)s|") % locals(), context=context)
82 locked = self.get_lock(context, instance_id)82 locked = self.get_lock(context, instance_id)
83 admin = context.is_admin83 admin = context.is_admin
84 LOG.info(_("check_instance_lock: locked: |%s|"), locked,84 LOG.info(_("check_instance_lock: locked: |%s|"), locked,
@@ -278,11 +278,11 @@
278 LOG.audit(_("Rebooting instance %s"), instance_id, context=context)278 LOG.audit(_("Rebooting instance %s"), instance_id, context=context)
279279
280 if instance_ref['state'] != power_state.RUNNING:280 if instance_ref['state'] != power_state.RUNNING:
281 state = instance_ref['state']
282 running = power_state.RUNNING
281 LOG.warn(_('trying to reboot a non-running '283 LOG.warn(_('trying to reboot a non-running '
282 'instance: %s (state: %s excepted: %s)'),284 'instance: %(instance_id)s (state: %(state)s '
283 instance_id,285 'expected: %(running)s)') % locals(),
284 instance_ref['state'],
285 power_state.RUNNING,
286 context=context)286 context=context)
287287
288 self.db.instance_set_state(context,288 self.db.instance_set_state(context,
@@ -307,9 +307,11 @@
307 LOG.audit(_('instance %s: snapshotting'), instance_id,307 LOG.audit(_('instance %s: snapshotting'), instance_id,
308 context=context)308 context=context)
309 if instance_ref['state'] != power_state.RUNNING:309 if instance_ref['state'] != power_state.RUNNING:
310 state = instance_ref['state']
311 running = power_state.RUNNING
310 LOG.warn(_('trying to snapshot a non-running '312 LOG.warn(_('trying to snapshot a non-running '
311 'instance: %s (state: %s excepted: %s)'),313 'instance: %(instance_id)s (state: %(state)s '
312 instance_id, instance_ref['state'], power_state.RUNNING)314 'expected: %(running)s)') % locals())
313315
314 self.driver.snapshot(instance_ref, image_id)316 self.driver.snapshot(instance_ref, image_id)
315317
@@ -517,8 +519,8 @@
517 """Attach a volume to an instance."""519 """Attach a volume to an instance."""
518 context = context.elevated()520 context = context.elevated()
519 instance_ref = self.db.instance_get(context, instance_id)521 instance_ref = self.db.instance_get(context, instance_id)
520 LOG.audit(_("instance %s: attaching volume %s to %s"), instance_id,522 LOG.audit(_("instance %(instance_id)s: attaching volume %(volume_id)s"
521 volume_id, mountpoint, context=context)523 " to %(mountpoint)s") % locals(), context=context)
522 dev_path = self.volume_manager.setup_compute_volume(context,524 dev_path = self.volume_manager.setup_compute_volume(context,
523 volume_id)525 volume_id)
524 try:526 try:
@@ -533,8 +535,8 @@
533 # NOTE(vish): The inline callback eats the exception info so we535 # NOTE(vish): The inline callback eats the exception info so we
534 # log the traceback here and reraise the same536 # log the traceback here and reraise the same
535 # ecxception below.537 # ecxception below.
536 LOG.exception(_("instance %s: attach failed %s, removing"),538 LOG.exception(_("instance %(instance_id)s: attach failed"
537 instance_id, mountpoint, context=context)539 " %(mountpoint)s, removing") % locals(), context=context)
538 self.volume_manager.remove_compute_volume(context,540 self.volume_manager.remove_compute_volume(context,
539 volume_id)541 volume_id)
540 raise exc542 raise exc
@@ -548,9 +550,9 @@
548 context = context.elevated()550 context = context.elevated()
549 instance_ref = self.db.instance_get(context, instance_id)551 instance_ref = self.db.instance_get(context, instance_id)
550 volume_ref = self.db.volume_get(context, volume_id)552 volume_ref = self.db.volume_get(context, volume_id)
551 LOG.audit(_("Detach volume %s from mountpoint %s on instance %s"),553 mp = volume_ref['mountpoint']
552 volume_id, volume_ref['mountpoint'], instance_id,554 LOG.audit(_("Detach volume %(volume_id)s from mountpoint %(mp)s"
553 context=context)555 " on instance %(instance_id)s") % locals(), context=context)
554 if instance_ref['name'] not in self.driver.list_instances():556 if instance_ref['name'] not in self.driver.list_instances():
555 LOG.warn(_("Detaching volume from unknown instance %s"),557 LOG.warn(_("Detaching volume from unknown instance %s"),
556 instance_id, context=context)558 instance_id, context=context)
557559
=== modified file 'nova/compute/monitor.py'
--- nova/compute/monitor.py 2011-01-04 05:26:41 +0000
+++ nova/compute/monitor.py 2011-01-24 15:23:08 +0000
@@ -352,8 +352,9 @@
352 rd += rd_bytes352 rd += rd_bytes
353 wr += wr_bytes353 wr += wr_bytes
354 except TypeError:354 except TypeError:
355 LOG.error(_('Cannot get blockstats for "%s" on "%s"'),355 iid = self.instance_id
356 disk, self.instance_id)356 LOG.error(_('Cannot get blockstats for "%(disk)s"'
357 ' on "%(iid)s"') % locals())
357 raise358 raise
358359
359 return '%d:%d' % (rd, wr)360 return '%d:%d' % (rd, wr)
@@ -374,8 +375,9 @@
374 rx += stats[0]375 rx += stats[0]
375 tx += stats[4]376 tx += stats[4]
376 except TypeError:377 except TypeError:
377 LOG.error(_('Cannot get ifstats for "%s" on "%s"'),378 iid = self.instance_id
378 interface, self.instance_id)379 LOG.error(_('Cannot get ifstats for "%(interface)s"'
380 ' on "%(iid)s"') % locals())
379 raise381 raise
380382
381 return '%d:%d' % (rx, tx)383 return '%d:%d' % (rx, tx)
382384
=== modified file 'nova/db/sqlalchemy/api.py'
--- nova/db/sqlalchemy/api.py 2011-01-20 01:34:54 +0000
+++ nova/db/sqlalchemy/api.py 2011-01-24 15:23:08 +0000
@@ -247,7 +247,8 @@
247 filter_by(deleted=can_read_deleted(context)).\247 filter_by(deleted=can_read_deleted(context)).\
248 first()248 first()
249 if not result:249 if not result:
250 raise exception.NotFound(_('No service for %s, %s') % (host, binary))250 raise exception.NotFound(_('No service for %(host)s, %(binary)s')
251 % locals())
251252
252 return result253 return result
253254
@@ -935,8 +936,8 @@
935 filter_by(deleted=can_read_deleted(context)).\936 filter_by(deleted=can_read_deleted(context)).\
936 first()937 first()
937 if not result:938 if not result:
938 raise exception.NotFound(_('no keypair for user %s, name %s') %939 raise exception.NotFound(_('no keypair for user %(user_id)s,'
939 (user_id, name))940 ' name %(name)s') % locals())
940 return result941 return result
941942
942943
@@ -1537,8 +1538,8 @@
1537 first()1538 first()
1538 if not result:1539 if not result:
1539 raise exception.NotFound(1540 raise exception.NotFound(
1540 _('No security group named %s for project: %s')1541 _('No security group named %(group_name)s'
1541 % (group_name, project_id))1542 ' for project: %(project_id)s') % locals())
1542 return result1543 return result
15431544
15441545
@@ -1922,8 +1923,8 @@
1922 filter_by(id=pool_id).\1923 filter_by(id=pool_id).\
1923 first()1924 first()
1924 if not result:1925 if not result:
1925 raise exception.NotFound(_("No console pool with id %(pool_id)s") %1926 raise exception.NotFound(_("No console pool with id %(pool_id)s")
1926 {'pool_id': pool_id})1927 % locals())
19271928
1928 return result1929 return result
19291930
@@ -1939,12 +1940,9 @@
1939 options(joinedload('consoles')).\1940 options(joinedload('consoles')).\
1940 first()1941 first()
1941 if not result:1942 if not result:
1942 raise exception.NotFound(_('No console pool of type %(type)s '1943 raise exception.NotFound(_('No console pool of type %(console_type)s '
1943 'for compute host %(compute_host)s '1944 'for compute host %(compute_host)s '
1944 'on proxy host %(host)s') %1945 'on proxy host %(host)s') % locals())
1945 {'type': console_type,
1946 'compute_host': compute_host,
1947 'host': host})
1948 return result1946 return result
19491947
19501948
@@ -1982,9 +1980,7 @@
1982 first()1980 first()
1983 if not result:1981 if not result:
1984 raise exception.NotFound(_('No console for instance %(instance_id)s '1982 raise exception.NotFound(_('No console for instance %(instance_id)s '
1985 'in pool %(pool_id)s') %1983 'in pool %(pool_id)s') % locals())
1986 {'instance_id': instance_id,
1987 'pool_id': pool_id})
1988 return result1984 return result
19891985
19901986
@@ -2005,9 +2001,7 @@
2005 query = query.filter_by(instance_id=instance_id)2001 query = query.filter_by(instance_id=instance_id)
2006 result = query.options(joinedload('pool')).first()2002 result = query.options(joinedload('pool')).first()
2007 if not result:2003 if not result:
2008 idesc = (_("on instance %s") % instance_id) if instance_id else ""2004 idesc = (_("on instance %s") % instance_id) if instance_id else ""
2009 raise exception.NotFound(_("No console with id %(console_id)s"2005 raise exception.NotFound(_("No console with id %(console_id)s"
2010 " %(instance)s") %2006 " %(idesc)s") % locals())
2011 {'instance': idesc,
2012 'console_id': console_id})
2013 return result2007 return result
20142008
=== modified file 'nova/exception.py'
--- nova/exception.py 2011-01-07 21:49:12 +0000
+++ nova/exception.py 2011-01-24 15:23:08 +0000
@@ -33,8 +33,9 @@
33 description = _("Unexpected error while running command.")33 description = _("Unexpected error while running command.")
34 if exit_code is None:34 if exit_code is None:
35 exit_code = '-'35 exit_code = '-'
36 message = _("%s\nCommand: %s\nExit code: %s\nStdout: %r\nStderr: %r")\36 message = _("%(description)s\nCommand: %(cmd)s\n"
37 % (description, cmd, exit_code, stdout, stderr)37 "Exit code: %(exit_code)s\nStdout: %(stdout)r\n"
38 "Stderr: %(stderr)r") % locals()
38 IOError.__init__(self, message)39 IOError.__init__(self, message)
3940
4041
4142
=== modified file 'nova/fakerabbit.py'
--- nova/fakerabbit.py 2011-01-04 05:23:35 +0000
+++ nova/fakerabbit.py 2011-01-24 15:23:08 +0000
@@ -45,8 +45,9 @@
45 self._routes = {}45 self._routes = {}
4646
47 def publish(self, message, routing_key=None):47 def publish(self, message, routing_key=None):
48 LOG.debug(_('(%s) publish (key: %s) %s'),48 nm = self.name
49 self.name, routing_key, message)49 LOG.debug(_('(%(nm)s) publish (key: %(routing_key)s)'
50 ' %(message)s') % locals())
50 routing_key = routing_key.split('.')[0]51 routing_key = routing_key.split('.')[0]
51 if routing_key in self._routes:52 if routing_key in self._routes:
52 for f in self._routes[routing_key]:53 for f in self._routes[routing_key]:
@@ -92,8 +93,8 @@
92 def queue_bind(self, queue, exchange, routing_key, **kwargs):93 def queue_bind(self, queue, exchange, routing_key, **kwargs):
93 global EXCHANGES94 global EXCHANGES
94 global QUEUES95 global QUEUES
95 LOG.debug(_('Binding %s to %s with key %s'),96 LOG.debug(_('Binding %(queue)s to %(exchange)s with'
96 queue, exchange, routing_key)97 ' key %(routing_key)s') % locals())
97 EXCHANGES[exchange].bind(QUEUES[queue].push, routing_key)98 EXCHANGES[exchange].bind(QUEUES[queue].push, routing_key)
9899
99 def declare_consumer(self, queue, callback, *args, **kwargs):100 def declare_consumer(self, queue, callback, *args, **kwargs):
@@ -117,7 +118,7 @@
117 content_type=content_type,118 content_type=content_type,
118 content_encoding=content_encoding)119 content_encoding=content_encoding)
119 message.result = True120 message.result = True
120 LOG.debug(_('Getting from %s: %s'), queue, message)121 LOG.debug(_('Getting from %(queue)s: %(message)s') % locals())
121 return message122 return message
122123
123 def prepare_message(self, message_data, delivery_mode,124 def prepare_message(self, message_data, delivery_mode,
124125
=== modified file 'nova/network/manager.py'
--- nova/network/manager.py 2011-01-20 17:52:02 +0000
+++ nova/network/manager.py 2011-01-24 15:23:08 +0000
@@ -198,8 +198,9 @@
198 raise exception.Error(_("IP %s leased that isn't associated") %198 raise exception.Error(_("IP %s leased that isn't associated") %
199 address)199 address)
200 if instance_ref['mac_address'] != mac:200 if instance_ref['mac_address'] != mac:
201 raise exception.Error(_("IP %s leased to bad mac %s vs %s") %201 inst_addr = instance_ref['mac_address']
202 (address, instance_ref['mac_address'], mac))202 raise exception.Error(_("IP %(address)s leased to bad"
203 " mac %(inst_addr)s vs %(mac)s") % locals())
203 now = datetime.datetime.utcnow()204 now = datetime.datetime.utcnow()
204 self.db.fixed_ip_update(context,205 self.db.fixed_ip_update(context,
205 fixed_ip_ref['address'],206 fixed_ip_ref['address'],
@@ -218,8 +219,9 @@
218 raise exception.Error(_("IP %s released that isn't associated") %219 raise exception.Error(_("IP %s released that isn't associated") %
219 address)220 address)
220 if instance_ref['mac_address'] != mac:221 if instance_ref['mac_address'] != mac:
221 raise exception.Error(_("IP %s released from bad mac %s vs %s") %222 inst_addr = instance_ref['mac_address']
222 (address, instance_ref['mac_address'], mac))223 raise exception.Error(_("IP %(address)s released from"
224 " bad mac %(inst_addr)s vs %(mac)s") % locals())
223 if not fixed_ip_ref['leased']:225 if not fixed_ip_ref['leased']:
224 LOG.warn(_("IP %s released that was not leased"), address,226 LOG.warn(_("IP %s released that was not leased"), address,
225 context=context)227 context=context)
226228
=== modified file 'nova/objectstore/handler.py'
--- nova/objectstore/handler.py 2011-01-20 17:52:02 +0000
+++ nova/objectstore/handler.py 2011-01-24 15:23:08 +0000
@@ -180,7 +180,7 @@
180 def render_GET(self, request): # pylint: disable-msg=R0201180 def render_GET(self, request): # pylint: disable-msg=R0201
181 """Renders the GET request for a list of buckets as XML"""181 """Renders the GET request for a list of buckets as XML"""
182 LOG.debug(_('List of buckets requested'), context=request.context)182 LOG.debug(_('List of buckets requested'), context=request.context)
183 buckets = [b for b in bucket.Bucket.all() \183 buckets = [b for b in bucket.Bucket.all()
184 if b.is_authorized(request.context)]184 if b.is_authorized(request.context)]
185185
186 render_xml(request, {"ListAllMyBucketsResult": {186 render_xml(request, {"ListAllMyBucketsResult": {
@@ -268,12 +268,14 @@
268 Raises NotAuthorized if user in request context is not268 Raises NotAuthorized if user in request context is not
269 authorized to delete the object.269 authorized to delete the object.
270 """270 """
271 LOG.debug(_("Getting object: %s / %s"), self.bucket.name, self.name)271 bname = self.bucket.name
272 nm = self.name
273 LOG.debug(_("Getting object: %(bname)s / %(nm)s") % locals())
272274
273 if not self.bucket.is_authorized(request.context):275 if not self.bucket.is_authorized(request.context):
274 LOG.audit(_("Unauthorized attempt to get object %s from bucket "276 LOG.audit(_("Unauthorized attempt to get object %(nm)s"
275 "%s"), self.name, self.bucket.name,277 " from bucket %(bname)s") % locals(),
276 context=request.context)278 context=request.context)
277 raise exception.NotAuthorized()279 raise exception.NotAuthorized()
278280
279 obj = self.bucket[urllib.unquote(self.name)]281 obj = self.bucket[urllib.unquote(self.name)]
@@ -289,12 +291,13 @@
289 Raises NotAuthorized if user in request context is not291 Raises NotAuthorized if user in request context is not
290 authorized to delete the object.292 authorized to delete the object.
291 """293 """
292 LOG.debug(_("Putting object: %s / %s"), self.bucket.name, self.name)294 nm = self.name
295 bname = self.bucket.name
296 LOG.debug(_("Putting object: %(bname)s / %(nm)s") % locals())
293297
294 if not self.bucket.is_authorized(request.context):298 if not self.bucket.is_authorized(request.context):
295 LOG.audit(_("Unauthorized attempt to upload object %s to bucket "299 LOG.audit(_("Unauthorized attempt to upload object %(nm)s to"
296 "%s"),300 " bucket %(bname)s") % locals(), context=request.context)
297 self.name, self.bucket.name, context=request.context)
298 raise exception.NotAuthorized()301 raise exception.NotAuthorized()
299302
300 key = urllib.unquote(self.name)303 key = urllib.unquote(self.name)
@@ -310,16 +313,14 @@
310 Raises NotAuthorized if user in request context is not313 Raises NotAuthorized if user in request context is not
311 authorized to delete the object.314 authorized to delete the object.
312 """315 """
313316 nm = self.name
314 LOG.debug(_("Deleting object: %s / %s"), self.bucket.name, self.name,317 bname = self.bucket.name
318 LOG.debug(_("Deleting object: %(bname)s / %(nm)s") % locals(),
315 context=request.context)319 context=request.context)
316320
317 if not self.bucket.is_authorized(request.context):321 if not self.bucket.is_authorized(request.context):
318 LOG.audit(_("Unauthorized attempt to delete object "322 LOG.audit(_("Unauthorized attempt to delete object %(nm)s from "
319 "%(object)s from bucket %(bucket)s") %323 "bucket %(bname)s") % locals(), context=request.context)
320 {'object': self.name,
321 'bucket': self.bucket.name},
322 context=request.context)
323 raise exception.NotAuthorized()324 raise exception.NotAuthorized()
324325
325 del self.bucket[urllib.unquote(self.name)]326 del self.bucket[urllib.unquote(self.name)]
@@ -390,10 +391,10 @@
390 image_location = get_argument(request, 'image_location', u'')391 image_location = get_argument(request, 'image_location', u'')
391392
392 image_path = os.path.join(FLAGS.images_path, image_id)393 image_path = os.path.join(FLAGS.images_path, image_id)
393 if not image_path.startswith(FLAGS.images_path) or \394 if ((not image_path.startswith(FLAGS.images_path)) or
394 os.path.exists(image_path):395 os.path.exists(image_path)):
395 LOG.audit(_("Not authorized to upload image: invalid directory "396 LOG.audit(_("Not authorized to upload image: invalid directory "
396 "%s"),397 "%s"),
397 image_path, context=request.context)398 image_path, context=request.context)
398 raise exception.NotAuthorized()399 raise exception.NotAuthorized()
399400
@@ -427,8 +428,8 @@
427 if operation:428 if operation:
428 # operation implies publicity toggle429 # operation implies publicity toggle
429 newstatus = (operation == 'add')430 newstatus = (operation == 'add')
430 LOG.audit(_("Toggling publicity flag of image %s %r"), image_id,431 LOG.audit(_("Toggling publicity flag of image %(image_id)s"
431 newstatus, context=request.context)432 " %(newstatus)r") % locals(), context=request.context)
432 image_object.set_public(newstatus)433 image_object.set_public(newstatus)
433 else:434 else:
434 # other attributes imply update435 # other attributes imply update
435436
=== modified file 'nova/rpc.py'
--- nova/rpc.py 2011-01-20 17:52:02 +0000
+++ nova/rpc.py 2011-01-24 15:23:08 +0000
@@ -89,15 +89,16 @@
89 self.failed_connection = False89 self.failed_connection = False
90 break90 break
91 except: # Catching all because carrot sucks91 except: # Catching all because carrot sucks
92 LOG.exception(_("AMQP server on %s:%d is unreachable."92 fl_host = FLAGS.rabbit_host
93 " Trying again in %d seconds.") % (93 fl_port = FLAGS.rabbit_port
94 FLAGS.rabbit_host,94 fl_intv = FLAGS.rabbit_retry_interval
95 FLAGS.rabbit_port,95 LOG.exception(_("AMQP server on %(fl_host)s:%(fl_port)d is"
96 FLAGS.rabbit_retry_interval))96 " unreachable. Trying again in %(fl_intv)d seconds.")
97 % locals())
97 self.failed_connection = True98 self.failed_connection = True
98 if self.failed_connection:99 if self.failed_connection:
99 LOG.exception(_("Unable to connect to AMQP server "100 LOG.exception(_("Unable to connect to AMQP server "
100 "after %d tries. Shutting down."),101 "after %d tries. Shutting down."),
101 FLAGS.rabbit_max_retries)102 FLAGS.rabbit_max_retries)
102 sys.exit(1)103 sys.exit(1)
103104
@@ -152,7 +153,7 @@
152class AdapterConsumer(TopicConsumer):153class AdapterConsumer(TopicConsumer):
153 """Calls methods on a proxy object based on method and args"""154 """Calls methods on a proxy object based on method and args"""
154 def __init__(self, connection=None, topic="broadcast", proxy=None):155 def __init__(self, connection=None, topic="broadcast", proxy=None):
155 LOG.debug(_('Initing the Adapter Consumer for %s') % (topic))156 LOG.debug(_('Initing the Adapter Consumer for %s') % topic)
156 self.proxy = proxy157 self.proxy = proxy
157 super(AdapterConsumer, self).__init__(connection=connection,158 super(AdapterConsumer, self).__init__(connection=connection,
158 topic=topic)159 topic=topic)
@@ -167,7 +168,7 @@
167168
168 Example: {'method': 'echo', 'args': {'value': 42}}169 Example: {'method': 'echo', 'args': {'value': 42}}
169 """170 """
170 LOG.debug(_('received %s') % (message_data))171 LOG.debug(_('received %s') % message_data)
171 msg_id = message_data.pop('_msg_id', None)172 msg_id = message_data.pop('_msg_id', None)
172173
173 ctxt = _unpack_context(message_data)174 ctxt = _unpack_context(message_data)
@@ -180,7 +181,7 @@
180 # messages stay in the queue indefinitely, so for now181 # messages stay in the queue indefinitely, so for now
181 # we just log the message and send an error string182 # we just log the message and send an error string
182 # back to the caller183 # back to the caller
183 LOG.warn(_('no method for message: %s') % (message_data))184 LOG.warn(_('no method for message: %s') % message_data)
184 msg_reply(msg_id, _('No method for message: %s') % message_data)185 msg_reply(msg_id, _('No method for message: %s') % message_data)
185 return186 return
186187
187188
=== modified file 'nova/scheduler/manager.py'
--- nova/scheduler/manager.py 2011-01-18 19:01:16 +0000
+++ nova/scheduler/manager.py 2011-01-24 15:23:08 +0000
@@ -66,4 +66,4 @@
66 db.queue_get_for(context, topic, host),66 db.queue_get_for(context, topic, host),
67 {"method": method,67 {"method": method,
68 "args": kwargs})68 "args": kwargs})
69 LOG.debug(_("Casting to %s %s for %s"), topic, host, method)69 LOG.debug(_("Casting to %(topic)s %(host)s for %(method)s") % locals())
7070
=== modified file 'nova/service.py'
--- nova/service.py 2011-01-20 11:20:50 +0000
+++ nova/service.py 2011-01-24 15:23:08 +0000
@@ -221,10 +221,10 @@
221221
222 name = '_'.join(x.binary for x in services)222 name = '_'.join(x.binary for x in services)
223 logging.debug(_("Serving %s"), name)223 logging.debug(_("Serving %s"), name)
224
225 logging.debug(_("Full set of FLAGS:"))224 logging.debug(_("Full set of FLAGS:"))
226 for flag in FLAGS:225 for flag in FLAGS:
227 logging.debug("%s : %s" % (flag, FLAGS.get(flag, None)))226 flag_get = FLAGS.get(flag, None)
227 logging.debug("%(flag)s : %(flag_get)s" % locals())
228228
229 for x in services:229 for x in services:
230 x.start()230 x.start()
231231
=== modified file 'nova/tests/test_rpc.py'
--- nova/tests/test_rpc.py 2011-01-07 14:46:17 +0000
+++ nova/tests/test_rpc.py 2011-01-24 15:23:08 +0000
@@ -86,7 +86,8 @@
86 @staticmethod86 @staticmethod
87 def echo(context, queue, value):87 def echo(context, queue, value):
88 """Calls echo in the passed queue"""88 """Calls echo in the passed queue"""
89 LOG.debug(_("Nested received %s, %s"), queue, value)89 LOG.debug(_("Nested received %(queue)s, %(value)s")
90 % locals())
90 ret = rpc.call(context,91 ret = rpc.call(context,
91 queue,92 queue,
92 {"method": "echo",93 {"method": "echo",
9394
=== modified file 'nova/utils.py'
--- nova/utils.py 2011-01-18 23:50:47 +0000
+++ nova/utils.py 2011-01-24 15:23:08 +0000
@@ -138,7 +138,7 @@
138 result = obj.communicate()138 result = obj.communicate()
139 obj.stdin.close()139 obj.stdin.close()
140 if obj.returncode:140 if obj.returncode:
141 LOG.debug(_("Result was %s") % (obj.returncode))141 LOG.debug(_("Result was %s") % obj.returncode)
142 if check_exit_code and obj.returncode != 0:142 if check_exit_code and obj.returncode != 0:
143 (stdout, stderr) = result143 (stdout, stderr) = result
144 raise ProcessExecutionError(exit_code=obj.returncode,144 raise ProcessExecutionError(exit_code=obj.returncode,
@@ -214,9 +214,11 @@
214 else:214 else:
215 return 'fe00::'215 return 'fe00::'
216 except IndexError as ex:216 except IndexError as ex:
217 LOG.warn(_("Couldn't get Link Local IP of %s :%s"), interface, ex)217 LOG.warn(_("Couldn't get Link Local IP of %(interface)s :%(ex)s")
218 % locals())
218 except ProcessExecutionError as ex:219 except ProcessExecutionError as ex:
219 LOG.warn(_("Couldn't get Link Local IP of %s :%s"), interface, ex)220 LOG.warn(_("Couldn't get Link Local IP of %(interface)s :%(ex)s")
221 % locals())
220 except:222 except:
221 return 'fe00::'223 return 'fe00::'
222224
223225
=== modified file 'nova/virt/hyperv.py'
--- nova/virt/hyperv.py 2011-01-12 11:43:29 +0000
+++ nova/virt/hyperv.py 2011-01-24 15:23:08 +0000
@@ -129,7 +129,7 @@
129 vm = self._lookup(instance.name)129 vm = self._lookup(instance.name)
130 if vm is not None:130 if vm is not None:
131 raise exception.Duplicate(_('Attempt to create duplicate vm %s') %131 raise exception.Duplicate(_('Attempt to create duplicate vm %s') %
132 instance.name)132 instance.name)
133133
134 user = manager.AuthManager().get_user(instance['user_id'])134 user = manager.AuthManager().get_user(instance['user_id'])
135 project = manager.AuthManager().get_project(instance['project_id'])135 project = manager.AuthManager().get_project(instance['project_id'])
@@ -159,7 +159,7 @@
159 vs_gs_data = self._conn.Msvm_VirtualSystemGlobalSettingData.new()159 vs_gs_data = self._conn.Msvm_VirtualSystemGlobalSettingData.new()
160 vs_gs_data.ElementName = instance['name']160 vs_gs_data.ElementName = instance['name']
161 (job, ret_val) = vs_man_svc.DefineVirtualSystem(161 (job, ret_val) = vs_man_svc.DefineVirtualSystem(
162 [], None, vs_gs_data.GetText_(1))[1:]162 [], None, vs_gs_data.GetText_(1))[1:]
163 if ret_val == WMI_JOB_STATUS_STARTED:163 if ret_val == WMI_JOB_STATUS_STARTED:
164 success = self._check_job_status(job)164 success = self._check_job_status(job)
165 else:165 else:
@@ -184,40 +184,40 @@
184 memsetting.Limit = mem184 memsetting.Limit = mem
185185
186 (job, ret_val) = vs_man_svc.ModifyVirtualSystemResources(186 (job, ret_val) = vs_man_svc.ModifyVirtualSystemResources(
187 vm.path_(), [memsetting.GetText_(1)])187 vm.path_(), [memsetting.GetText_(1)])
188 LOG.debug(_('Set memory for vm %s...'), instance.name)188 LOG.debug(_('Set memory for vm %s...'), instance.name)
189 procsetting = vmsetting.associators(189 procsetting = vmsetting.associators(
190 wmi_result_class='Msvm_ProcessorSettingData')[0]190 wmi_result_class='Msvm_ProcessorSettingData')[0]
191 vcpus = long(instance['vcpus'])191 vcpus = long(instance['vcpus'])
192 procsetting.VirtualQuantity = vcpus192 procsetting.VirtualQuantity = vcpus
193 procsetting.Reservation = vcpus193 procsetting.Reservation = vcpus
194 procsetting.Limit = vcpus194 procsetting.Limit = vcpus
195195
196 (job, ret_val) = vs_man_svc.ModifyVirtualSystemResources(196 (job, ret_val) = vs_man_svc.ModifyVirtualSystemResources(
197 vm.path_(), [procsetting.GetText_(1)])197 vm.path_(), [procsetting.GetText_(1)])
198 LOG.debug(_('Set vcpus for vm %s...'), instance.name)198 LOG.debug(_('Set vcpus for vm %s...'), instance.name)
199199
200 def _create_disk(self, vm_name, vhdfile):200 def _create_disk(self, vm_name, vhdfile):
201 """Create a disk and attach it to the vm"""201 """Create a disk and attach it to the vm"""
202 LOG.debug(_('Creating disk for %s by attaching disk file %s'),202 LOG.debug(_('Creating disk for %(vm_name)s by attaching'
203 vm_name, vhdfile)203 ' disk file %(vhdfile)s') % locals())
204 #Find the IDE controller for the vm.204 #Find the IDE controller for the vm.
205 vms = self._conn.MSVM_ComputerSystem(ElementName=vm_name)205 vms = self._conn.MSVM_ComputerSystem(ElementName=vm_name)
206 vm = vms[0]206 vm = vms[0]
207 vmsettings = vm.associators(207 vmsettings = vm.associators(
208 wmi_result_class='Msvm_VirtualSystemSettingData')208 wmi_result_class='Msvm_VirtualSystemSettingData')
209 rasds = vmsettings[0].associators(209 rasds = vmsettings[0].associators(
210 wmi_result_class='MSVM_ResourceAllocationSettingData')210 wmi_result_class='MSVM_ResourceAllocationSettingData')
211 ctrller = [r for r in rasds211 ctrller = [r for r in rasds
212 if r.ResourceSubType == 'Microsoft Emulated IDE Controller'\212 if r.ResourceSubType == 'Microsoft Emulated IDE Controller'\
213 and r.Address == "0"]213 and r.Address == "0"]
214 #Find the default disk drive object for the vm and clone it.214 #Find the default disk drive object for the vm and clone it.
215 diskdflt = self._conn.query(215 diskdflt = self._conn.query(
216 "SELECT * FROM Msvm_ResourceAllocationSettingData \216 "SELECT * FROM Msvm_ResourceAllocationSettingData \
217 WHERE ResourceSubType LIKE 'Microsoft Synthetic Disk Drive'\217 WHERE ResourceSubType LIKE 'Microsoft Synthetic Disk Drive'\
218 AND InstanceID LIKE '%Default%'")[0]218 AND InstanceID LIKE '%Default%'")[0]
219 diskdrive = self._clone_wmi_obj(219 diskdrive = self._clone_wmi_obj(
220 'Msvm_ResourceAllocationSettingData', diskdflt)220 'Msvm_ResourceAllocationSettingData', diskdflt)
221 #Set the IDE ctrller as parent.221 #Set the IDE ctrller as parent.
222 diskdrive.Parent = ctrller[0].path_()222 diskdrive.Parent = ctrller[0].path_()
223 diskdrive.Address = 0223 diskdrive.Address = 0
@@ -263,17 +263,18 @@
263 default_nic_data = [n for n in emulatednics_data263 default_nic_data = [n for n in emulatednics_data
264 if n.InstanceID.rfind('Default') > 0]264 if n.InstanceID.rfind('Default') > 0]
265 new_nic_data = self._clone_wmi_obj(265 new_nic_data = self._clone_wmi_obj(
266 'Msvm_EmulatedEthernetPortSettingData',266 'Msvm_EmulatedEthernetPortSettingData',
267 default_nic_data[0])267 default_nic_data[0])
268 #Create a port on the vswitch.268 #Create a port on the vswitch.
269 (new_port, ret_val) = switch_svc.CreateSwitchPort(vm_name, vm_name,269 (new_port, ret_val) = switch_svc.CreateSwitchPort(vm_name, vm_name,
270 "", extswitch.path_())270 "", extswitch.path_())
271 if ret_val != 0:271 if ret_val != 0:
272 LOG.error(_('Failed creating a port on the external vswitch'))272 LOG.error(_('Failed creating a port on the external vswitch'))
273 raise Exception(_('Failed creating port for %s'),273 raise Exception(_('Failed creating port for %s'),
274 vm_name)274 vm_name)
275 LOG.debug(_("Created switch port %s on switch %s"),275 ext_path = extswitch.path_()
276 vm_name, extswitch.path_())276 LOG.debug(_("Created switch port %(vm_name)s on switch %(ext_path)s")
277 % locals())
277 #Connect the new nic to the new port.278 #Connect the new nic to the new port.
278 new_nic_data.Connection = [new_port]279 new_nic_data.Connection = [new_port]
279 new_nic_data.ElementName = vm_name + ' nic'280 new_nic_data.ElementName = vm_name + ' nic'
@@ -283,7 +284,7 @@
283 new_resources = self._add_virt_resource(new_nic_data, vm)284 new_resources = self._add_virt_resource(new_nic_data, vm)
284 if new_resources is None:285 if new_resources is None:
285 raise Exception(_('Failed to add nic to VM %s'),286 raise Exception(_('Failed to add nic to VM %s'),
286 vm_name)287 vm_name)
287 LOG.info(_("Created nic for %s "), vm_name)288 LOG.info(_("Created nic for %s "), vm_name)
288289
289 def _add_virt_resource(self, res_setting_data, target_vm):290 def _add_virt_resource(self, res_setting_data, target_vm):
@@ -319,8 +320,10 @@
319 if job.JobState != WMI_JOB_STATE_COMPLETED:320 if job.JobState != WMI_JOB_STATE_COMPLETED:
320 LOG.debug(_("WMI job failed: %s"), job.ErrorSummaryDescription)321 LOG.debug(_("WMI job failed: %s"), job.ErrorSummaryDescription)
321 return False322 return False
322 LOG.debug(_("WMI job succeeded: %s, Elapsed=%s "), job.Description,323 desc = job.Description
323 job.ElapsedTime)324 elap = job.ElapsedTime
325 LOG.debug(_("WMI job succeeded: %(desc)s, Elapsed=%(elap)s ")
326 % locals())
324 return True327 return True
325328
326 def _find_external_network(self):329 def _find_external_network(self):
@@ -386,7 +389,9 @@
386 vhdfile = self._cim_conn.CIM_DataFile(Name=disk)389 vhdfile = self._cim_conn.CIM_DataFile(Name=disk)
387 for vf in vhdfile:390 for vf in vhdfile:
388 vf.Delete()391 vf.Delete()
389 LOG.debug(_("Del: disk %s vm %s"), vhdfile, instance.name)392 instance_name = instance.name
393 LOG.debug(_("Del: disk %(vhdfile)s vm %(instance_name)s")
394 % locals())
390395
391 def get_info(self, instance_id):396 def get_info(self, instance_id):
392 """Get information about the VM"""397 """Get information about the VM"""
@@ -402,12 +407,14 @@
402 summary_info = vs_man_svc.GetSummaryInformation(407 summary_info = vs_man_svc.GetSummaryInformation(
403 [4, 100, 103, 105], settings_paths)[1]408 [4, 100, 103, 105], settings_paths)[1]
404 info = summary_info[0]409 info = summary_info[0]
405 LOG.debug(_("Got Info for vm %s: state=%s, mem=%s, num_cpu=%s, \410 state = str(HYPERV_POWER_STATE[info.EnabledState])
406 cpu_time=%s"), instance_id,411 memusage = str(info.MemoryUsage)
407 str(HYPERV_POWER_STATE[info.EnabledState]),412 numprocs = str(info.NumberOfProcessors)
408 str(info.MemoryUsage),413 uptime = str(info.UpTime)
409 str(info.NumberOfProcessors),414
410 str(info.UpTime))415 LOG.debug(_("Got Info for vm %(instance_id)s: state=%(state)s,"
416 " mem=%(memusage)s, num_cpu=%(numprocs)s,"
417 " cpu_time=%(uptime)s") % locals())
411418
412 return {'state': HYPERV_POWER_STATE[info.EnabledState],419 return {'state': HYPERV_POWER_STATE[info.EnabledState],
413 'max_mem': info.MemoryUsage,420 'max_mem': info.MemoryUsage,
@@ -441,22 +448,22 @@
441 #already in the state requested448 #already in the state requested
442 success = True449 success = True
443 if success:450 if success:
444 LOG.info(_("Successfully changed vm state of %s to %s"), vm_name,451 LOG.info(_("Successfully changed vm state of %(vm_name)s"
445 req_state)452 " to %(req_state)s") % locals())
446 else:453 else:
447 LOG.error(_("Failed to change vm state of %s to %s"), vm_name,454 msg = _("Failed to change vm state of %(vm_name)s"
448 req_state)455 " to %(req_state)s") % locals()
449 raise Exception(_("Failed to change vm state of %s to %s"),456 LOG.error(msg)
450 vm_name, req_state)457 raise Exception(msg)
451458
452 def attach_volume(self, instance_name, device_path, mountpoint):459 def attach_volume(self, instance_name, device_path, mountpoint):
453 vm = self._lookup(instance_name)460 vm = self._lookup(instance_name)
454 if vm is None:461 if vm is None:
455 raise exception.NotFound('Cannot attach volume to missing %s vm' %462 raise exception.NotFound('Cannot attach volume to missing %s vm'
456 instance_name)463 % instance_name)
457464
458 def detach_volume(self, instance_name, mountpoint):465 def detach_volume(self, instance_name, mountpoint):
459 vm = self._lookup(instance_name)466 vm = self._lookup(instance_name)
460 if vm is None:467 if vm is None:
461 raise exception.NotFound('Cannot detach volume from missing %s ' %468 raise exception.NotFound('Cannot detach volume from missing %s '
462 instance_name)469 % instance_name)
463470
=== modified file 'nova/virt/images.py'
--- nova/virt/images.py 2011-01-07 20:29:35 +0000
+++ nova/virt/images.py 2011-01-24 15:23:08 +0000
@@ -67,7 +67,7 @@
6767
68 urlopened = urllib2.urlopen(request)68 urlopened = urllib2.urlopen(request)
69 urlretrieve(urlopened, path)69 urlretrieve(urlopened, path)
70 LOG.debug(_("Finished retreving %s -- placed in %s"), url, path)70 LOG.debug(_("Finished retreving %(url)s -- placed in %(path)s") % locals())
7171
7272
73def _fetch_s3_image(image, path, user, project):73def _fetch_s3_image(image, path, user, project):
7474
=== modified file 'nova/virt/libvirt_conn.py'
--- nova/virt/libvirt_conn.py 2011-01-21 09:08:21 +0000
+++ nova/virt/libvirt_conn.py 2011-01-24 15:23:08 +0000
@@ -236,8 +236,9 @@
236236
237 def _cleanup(self, instance):237 def _cleanup(self, instance):
238 target = os.path.join(FLAGS.instances_path, instance['name'])238 target = os.path.join(FLAGS.instances_path, instance['name'])
239 LOG.info(_('instance %s: deleting instance files %s'),239 instance_name = instance['name']
240 instance['name'], target)240 LOG.info(_('instance %(instance_name)s: deleting instance files'
241 ' %(target)s') % locals())
241 if os.path.exists(target):242 if os.path.exists(target):
242 shutil.rmtree(target)243 shutil.rmtree(target)
243244
@@ -418,7 +419,7 @@
418 virsh_output = virsh_output[0].strip()419 virsh_output = virsh_output[0].strip()
419420
420 if virsh_output.startswith('/dev/'):421 if virsh_output.startswith('/dev/'):
421 LOG.info(_('cool, it\'s a device'))422 LOG.info(_("cool, it's a device"))
422 out, err = utils.execute("sudo dd if=%s iflag=nonblock" %423 out, err = utils.execute("sudo dd if=%s iflag=nonblock" %
423 virsh_output, check_exit_code=False)424 virsh_output, check_exit_code=False)
424 return out425 return out
@@ -426,7 +427,7 @@
426 return ''427 return ''
427428
428 def _append_to_file(self, data, fpath):429 def _append_to_file(self, data, fpath):
429 LOG.info(_('data: %r, fpath: %r'), data, fpath)430 LOG.info(_('data: %(data)r, fpath: %(fpath)r') % locals())
430 fp = open(fpath, 'a+')431 fp = open(fpath, 'a+')
431 fp.write(data)432 fp.write(data)
432 return fpath433 return fpath
@@ -434,7 +435,7 @@
434 def _dump_file(self, fpath):435 def _dump_file(self, fpath):
435 fp = open(fpath, 'r+')436 fp = open(fpath, 'r+')
436 contents = fp.read()437 contents = fp.read()
437 LOG.info(_('Contents of file %s: %r'), fpath, contents)438 LOG.info(_('Contents of file %(fpath)s: %(contents)r') % locals())
438 return contents439 return contents
439440
440 @exception.wrap_exception441 @exception.wrap_exception
@@ -621,21 +622,22 @@
621 'dns': network_ref['dns'],622 'dns': network_ref['dns'],
622 'ra_server': ra_server}623 'ra_server': ra_server}
623 if key or net:624 if key or net:
625 inst_name = inst['name']
626 img_id = inst.image_id
624 if key:627 if key:
625 LOG.info(_('instance %s: injecting key into image %s'),628 LOG.info(_('instance %(inst_name)s: injecting key into'
626 inst['name'], inst.image_id)629 ' image %(img_id)s') % locals())
627 if net:630 if net:
628 LOG.info(_('instance %s: injecting net into image %s'),631 LOG.info(_('instance %(inst_name)s: injecting net into'
629 inst['name'], inst.image_id)632 ' image %(img_id)s') % locals())
630 try:633 try:
631 disk.inject_data(basepath('disk'), key, net,634 disk.inject_data(basepath('disk'), key, net,
632 partition=target_partition,635 partition=target_partition,
633 nbd=FLAGS.use_cow_images)636 nbd=FLAGS.use_cow_images)
634 except Exception as e:637 except Exception as e:
635 # This could be a windows image, or a vmdk format disk638 # This could be a windows image, or a vmdk format disk
636 LOG.warn(_('instance %s: ignoring error injecting data'639 LOG.warn(_('instance %(inst_name)s: ignoring error injecting'
637 ' into image %s (%s)'),640 ' data into image %(img_id)s (%(e)s)') % locals())
638 inst['name'], inst.image_id, e)
639641
640 if FLAGS.libvirt_type == 'uml':642 if FLAGS.libvirt_type == 'uml':
641 utils.execute('sudo chown root %s' % basepath('disk'))643 utils.execute('sudo chown root %s' % basepath('disk'))
642644
=== modified file 'nova/virt/xenapi/fake.py'
--- nova/virt/xenapi/fake.py 2011-01-12 11:54:58 +0000
+++ nova/virt/xenapi/fake.py 2011-01-24 15:23:08 +0000
@@ -69,7 +69,9 @@
6969
7070
71def log_db_contents(msg=None):71def log_db_contents(msg=None):
72 LOG.debug(_("%s: _db_content => %s"), msg or "", pformat(_db_content))72 text = msg or ""
73 content = pformat(_db_content)
74 LOG.debug(_("%(text)s: _db_content => %(content)s") % locals())
7375
7476
75def reset():77def reset():
@@ -331,7 +333,8 @@
331 if impl is not None:333 if impl is not None:
332334
333 def callit(*params):335 def callit(*params):
334 LOG.debug(_('Calling %s %s'), name, impl)336 localname = name
337 LOG.debug(_('Calling %(localname)s %(impl)s') % locals())
335 self._check_session(params)338 self._check_session(params)
336 return impl(*params)339 return impl(*params)
337 return callit340 return callit
338341
=== modified file 'nova/virt/xenapi/vm_utils.py'
--- nova/virt/xenapi/vm_utils.py 2011-01-21 22:16:52 +0000
+++ nova/virt/xenapi/vm_utils.py 2011-01-24 15:23:08 +0000
@@ -134,7 +134,8 @@
134 'pae': 'true', 'viridian': 'true'}134 'pae': 'true', 'viridian': 'true'}
135 LOG.debug(_('Created VM %s...'), instance.name)135 LOG.debug(_('Created VM %s...'), instance.name)
136 vm_ref = session.call_xenapi('VM.create', rec)136 vm_ref = session.call_xenapi('VM.create', rec)
137 LOG.debug(_('Created VM %s as %s.'), instance.name, vm_ref)137 instance_name = instance.name
138 LOG.debug(_('Created VM %(instance_name)s as %(vm_ref)s.') % locals())
138 return vm_ref139 return vm_ref
139140
140 @classmethod141 @classmethod
@@ -154,10 +155,11 @@
154 vbd_rec['qos_algorithm_type'] = ''155 vbd_rec['qos_algorithm_type'] = ''
155 vbd_rec['qos_algorithm_params'] = {}156 vbd_rec['qos_algorithm_params'] = {}
156 vbd_rec['qos_supported_algorithms'] = []157 vbd_rec['qos_supported_algorithms'] = []
157 LOG.debug(_('Creating VBD for VM %s, VDI %s ... '), vm_ref, vdi_ref)158 LOG.debug(_('Creating VBD for VM %(vm_ref)s,'
159 ' VDI %(vdi_ref)s ... ') % locals())
158 vbd_ref = session.call_xenapi('VBD.create', vbd_rec)160 vbd_ref = session.call_xenapi('VBD.create', vbd_rec)
159 LOG.debug(_('Created VBD %s for VM %s, VDI %s.'), vbd_ref, vm_ref,161 LOG.debug(_('Created VBD %(vbd_ref)s for VM %(vm_ref)s,'
160 vdi_ref)162 ' VDI %(vdi_ref)s.') % locals())
161 return vbd_ref163 return vbd_ref
162164
163 @classmethod165 @classmethod
@@ -209,11 +211,11 @@
209 vif_rec['other_config'] = {}211 vif_rec['other_config'] = {}
210 vif_rec['qos_algorithm_type'] = ''212 vif_rec['qos_algorithm_type'] = ''
211 vif_rec['qos_algorithm_params'] = {}213 vif_rec['qos_algorithm_params'] = {}
212 LOG.debug(_('Creating VIF for VM %s, network %s.'), vm_ref,214 LOG.debug(_('Creating VIF for VM %(vm_ref)s,'
213 network_ref)215 ' network %(network_ref)s.') % locals())
214 vif_ref = session.call_xenapi('VIF.create', vif_rec)216 vif_ref = session.call_xenapi('VIF.create', vif_rec)
215 LOG.debug(_('Created VIF %s for VM %s, network %s.'), vif_ref,217 LOG.debug(_('Created VIF %(vif_ref)s for VM %(vm_ref)s,'
216 vm_ref, network_ref)218 ' network %(network_ref)s.') % locals())
217 return vif_ref219 return vif_ref
218220
219 @classmethod221 @classmethod
@@ -231,8 +233,9 @@
231 'other_config': {},233 'other_config': {},
232 'sm_config': {},234 'sm_config': {},
233 'tags': []})235 'tags': []})
234 LOG.debug(_('Created VDI %s (%s, %s, %s) on %s.'), vdi_ref,236 LOG.debug(_('Created VDI %(vdi_ref)s (%(name_label)s,'
235 name_label, virtual_size, read_only, sr_ref)237 ' %(virtual_size)s, %(read_only)s) on %(sr_ref)s.')
238 % locals())
236 return vdi_ref239 return vdi_ref
237240
238 @classmethod241 @classmethod
@@ -242,7 +245,8 @@
242 """245 """
243 #TODO(sirp): Add quiesce and VSS locking support when Windows support246 #TODO(sirp): Add quiesce and VSS locking support when Windows support
244 # is added247 # is added
245 LOG.debug(_("Snapshotting VM %s with label '%s'..."), vm_ref, label)248 LOG.debug(_("Snapshotting VM %(vm_ref)s with label '%(label)s'...")
249 % locals())
246250
247 vm_vdi_ref, vm_vdi_rec = get_vdi_for_vm_safely(session, vm_ref)251 vm_vdi_ref, vm_vdi_rec = get_vdi_for_vm_safely(session, vm_ref)
248 vm_vdi_uuid = vm_vdi_rec["uuid"]252 vm_vdi_uuid = vm_vdi_rec["uuid"]
@@ -255,8 +259,8 @@
255 template_vdi_rec = get_vdi_for_vm_safely(session, template_vm_ref)[1]259 template_vdi_rec = get_vdi_for_vm_safely(session, template_vm_ref)[1]
256 template_vdi_uuid = template_vdi_rec["uuid"]260 template_vdi_uuid = template_vdi_rec["uuid"]
257261
258 LOG.debug(_('Created snapshot %s from VM %s.'), template_vm_ref,262 LOG.debug(_('Created snapshot %(template_vm_ref)s from'
259 vm_ref)263 ' VM %(vm_ref)s.') % locals())
260264
261 parent_uuid = wait_for_vhd_coalesce(265 parent_uuid = wait_for_vhd_coalesce(
262 session, instance_id, sr_ref, vm_vdi_ref, original_parent_uuid)266 session, instance_id, sr_ref, vm_vdi_ref, original_parent_uuid)
@@ -269,8 +273,8 @@
269 """ Requests that the Glance plugin bundle the specified VDIs and273 """ Requests that the Glance plugin bundle the specified VDIs and
270 push them into Glance using the specified human-friendly name.274 push them into Glance using the specified human-friendly name.
271 """275 """
272 logging.debug(_("Asking xapi to upload %s as ID %s"),276 logging.debug(_("Asking xapi to upload %(vdi_uuids)s as"
273 vdi_uuids, image_id)277 " ID %(image_id)s") % locals())
274278
275 params = {'vdi_uuids': vdi_uuids,279 params = {'vdi_uuids': vdi_uuids,
276 'image_id': image_id,280 'image_id': image_id,
@@ -310,7 +314,7 @@
310 meta, image_file = c.get_image(image)314 meta, image_file = c.get_image(image)
311 virtual_size = int(meta['size'])315 virtual_size = int(meta['size'])
312 vdi_size = virtual_size316 vdi_size = virtual_size
313 LOG.debug(_("Size for image %s:%d"), image, virtual_size)317 LOG.debug(_("Size for image %(image)s:%(virtual_size)d") % locals())
314 if type == ImageType.DISK:318 if type == ImageType.DISK:
315 # Make room for MBR.319 # Make room for MBR.
316 vdi_size += MBR_SIZE_BYTES320 vdi_size += MBR_SIZE_BYTES
@@ -344,7 +348,7 @@
344 def _fetch_image_objectstore(cls, session, instance_id, image, access,348 def _fetch_image_objectstore(cls, session, instance_id, image, access,
345 secret, type):349 secret, type):
346 url = images.image_url(image)350 url = images.image_url(image)
347 LOG.debug(_("Asking xapi to fetch %s as %s"), url, access)351 LOG.debug(_("Asking xapi to fetch %(url)s as %(access)s") % locals())
348 fn = (type != ImageType.KERNEL_RAMDISK) and 'get_vdi' or 'get_kernel'352 fn = (type != ImageType.KERNEL_RAMDISK) and 'get_vdi' or 'get_kernel'
349 args = {}353 args = {}
350 args['src_url'] = url354 args['src_url'] = url
@@ -499,7 +503,8 @@
499 parent_uuid = vdi_rec['sm_config']['vhd-parent']503 parent_uuid = vdi_rec['sm_config']['vhd-parent']
500 parent_ref = session.get_xenapi().VDI.get_by_uuid(parent_uuid)504 parent_ref = session.get_xenapi().VDI.get_by_uuid(parent_uuid)
501 parent_rec = session.get_xenapi().VDI.get_record(parent_ref)505 parent_rec = session.get_xenapi().VDI.get_record(parent_ref)
502 LOG.debug(_("VHD %s has parent %s"), vdi_rec['uuid'], parent_ref)506 vdi_uuid = vdi_rec['uuid']
507 LOG.debug(_("VHD %(vdi_uuid)s has parent %(parent_ref)s") % locals())
503 return parent_ref, parent_rec508 return parent_ref, parent_rec
504 else:509 else:
505 return None510 return None
@@ -540,16 +545,17 @@
540 def _poll_vhds():545 def _poll_vhds():
541 attempts['counter'] += 1546 attempts['counter'] += 1
542 if attempts['counter'] > max_attempts:547 if attempts['counter'] > max_attempts:
543 msg = (_("VHD coalesce attempts exceeded (%d > %d), giving up...")548 counter = attempts['counter']
544 % (attempts['counter'], max_attempts))549 msg = (_("VHD coalesce attempts exceeded (%(counter)d >"
550 " %(max_attempts)d), giving up...") % locals())
545 raise exception.Error(msg)551 raise exception.Error(msg)
546552
547 scan_sr(session, instance_id, sr_ref)553 scan_sr(session, instance_id, sr_ref)
548 parent_uuid = get_vhd_parent_uuid(session, vdi_ref)554 parent_uuid = get_vhd_parent_uuid(session, vdi_ref)
549 if original_parent_uuid and (parent_uuid != original_parent_uuid):555 if original_parent_uuid and (parent_uuid != original_parent_uuid):
550 LOG.debug(_("Parent %s doesn't match original parent %s, "556 LOG.debug(_("Parent %(parent_uuid)s doesn't match original parent"
551 "waiting for coalesce..."), parent_uuid,557 " %(original_parent_uuid)s, waiting for coalesce...")
552 original_parent_uuid)558 % locals())
553 else:559 else:
554 # Breakout of the loop (normally) and return the parent_uuid560 # Breakout of the loop (normally) and return the parent_uuid
555 raise utils.LoopingCallDone(parent_uuid)561 raise utils.LoopingCallDone(parent_uuid)
@@ -567,8 +573,8 @@
567 else:573 else:
568 num_vdis = len(vdi_refs)574 num_vdis = len(vdi_refs)
569 if num_vdis != 1:575 if num_vdis != 1:
570 raise Exception(_("Unexpected number of VDIs (%s) found for "576 raise Exception(_("Unexpected number of VDIs (%(num_vdis)s) found"
571 "VM %s") % (num_vdis, vm_ref))577 " for VM %(vm_ref)s") % locals())
572578
573 vdi_ref = vdi_refs[0]579 vdi_ref = vdi_refs[0]
574 vdi_rec = session.get_xenapi().VDI.get_record(vdi_ref)580 vdi_rec = session.get_xenapi().VDI.get_record(vdi_ref)
@@ -708,8 +714,8 @@
708 primary_first = MBR_SIZE_SECTORS714 primary_first = MBR_SIZE_SECTORS
709 primary_last = MBR_SIZE_SECTORS + (virtual_size / SECTOR_SIZE) - 1715 primary_last = MBR_SIZE_SECTORS + (virtual_size / SECTOR_SIZE) - 1
710716
711 LOG.debug(_('Writing partition table %d %d to %s...'),717 LOG.debug(_('Writing partition table %(primary_first)d %(primary_last)d'
712 primary_first, primary_last, dest)718 ' to %(dest)s...') % locals())
713719
714 def execute(cmd, process_input=None, check_exit_code=True):720 def execute(cmd, process_input=None, check_exit_code=True):
715 return utils.execute(cmd=cmd,721 return utils.execute(cmd=cmd,
716722
=== modified file 'nova/virt/xenapi/vmops.py'
--- nova/virt/xenapi/vmops.py 2011-01-22 04:59:58 +0000
+++ nova/virt/xenapi/vmops.py 2011-01-24 15:23:08 +0000
@@ -104,7 +104,9 @@
104 network_ref, instance.mac_address)104 network_ref, instance.mac_address)
105 LOG.debug(_('Starting VM %s...'), vm_ref)105 LOG.debug(_('Starting VM %s...'), vm_ref)
106 self._session.call_xenapi('VM.start', vm_ref, False, False)106 self._session.call_xenapi('VM.start', vm_ref, False, False)
107 LOG.info(_('Spawning VM %s created %s.'), instance.name, vm_ref)107 instance_name = instance.name
108 LOG.info(_('Spawning VM %(instance_name)s created %(vm_ref)s.')
109 % locals())
108110
109 # NOTE(armando): Do we really need to do this in virt?111 # NOTE(armando): Do we really need to do this in virt?
110 timer = utils.LoopingCall(f=None)112 timer = utils.LoopingCall(f=None)
@@ -196,7 +198,8 @@
196 template_vm_ref, template_vdi_uuids = VMHelper.create_snapshot(198 template_vm_ref, template_vdi_uuids = VMHelper.create_snapshot(
197 self._session, instance.id, vm_ref, label)199 self._session, instance.id, vm_ref, label)
198 except self.XenAPI.Failure, exc:200 except self.XenAPI.Failure, exc:
199 logging.error(_("Unable to Snapshot %s: %s"), vm_ref, exc)201 logging.error(_("Unable to Snapshot %(vm_ref)s: %(exc)s")
202 % locals())
200 return203 return
201204
202 try:205 try:
203206
=== modified file 'nova/virt/xenapi/volume_utils.py'
--- nova/virt/xenapi/volume_utils.py 2011-01-07 14:46:17 +0000
+++ nova/virt/xenapi/volume_utils.py 2011-01-24 15:23:08 +0000
@@ -71,7 +71,7 @@
71 session.get_xenapi_host(),71 session.get_xenapi_host(),
72 record,72 record,
73 '0', label, description, 'iscsi', '', False, {})73 '0', label, description, 'iscsi', '', False, {})
74 LOG.debug(_('Introduced %s as %s.'), label, sr_ref)74 LOG.debug(_('Introduced %(label)s as %(sr_ref)s.') % locals())
75 return sr_ref75 return sr_ref
76 except cls.XenAPI.Failure, exc:76 except cls.XenAPI.Failure, exc:
77 LOG.exception(exc)77 LOG.exception(exc)
@@ -98,20 +98,20 @@
98 try:98 try:
99 pbds = session.get_xenapi().SR.get_PBDs(sr_ref)99 pbds = session.get_xenapi().SR.get_PBDs(sr_ref)
100 except cls.XenAPI.Failure, exc:100 except cls.XenAPI.Failure, exc:
101 LOG.warn(_('Ignoring exception %s when getting PBDs for %s'),101 LOG.warn(_('Ignoring exception %(exc)s when getting PBDs'
102 exc, sr_ref)102 ' for %(sr_ref)s') % locals())
103 for pbd in pbds:103 for pbd in pbds:
104 try:104 try:
105 session.get_xenapi().PBD.unplug(pbd)105 session.get_xenapi().PBD.unplug(pbd)
106 except cls.XenAPI.Failure, exc:106 except cls.XenAPI.Failure, exc:
107 LOG.warn(_('Ignoring exception %s when unplugging PBD %s'),107 LOG.warn(_('Ignoring exception %(exc)s when unplugging'
108 exc, pbd)108 ' PBD %(pbd)s') % locals())
109 try:109 try:
110 session.get_xenapi().SR.forget(sr_ref)110 session.get_xenapi().SR.forget(sr_ref)
111 LOG.debug(_("Forgetting SR %s done."), sr_ref)111 LOG.debug(_("Forgetting SR %s done."), sr_ref)
112 except cls.XenAPI.Failure, exc:112 except cls.XenAPI.Failure, exc:
113 LOG.warn(_('Ignoring exception %s when forgetting SR %s'), exc,113 LOG.warn(_('Ignoring exception %(exc)s when forgetting'
114 sr_ref)114 ' SR %(sr_ref)s') % locals())
115115
116 @classmethod116 @classmethod
117 def introduce_vdi(cls, session, sr_ref):117 def introduce_vdi(cls, session, sr_ref):
@@ -172,8 +172,8 @@
172 (volume_id is None) or \172 (volume_id is None) or \
173 (target_host is None) or \173 (target_host is None) or \
174 (target_iqn is None):174 (target_iqn is None):
175 raise StorageError(_('Unable to obtain target information %s, %s')175 raise StorageError(_('Unable to obtain target information'
176 % (device_path, mountpoint))176 ' %(device_path)s, %(mountpoint)s') % locals())
177 volume_info = {}177 volume_info = {}
178 volume_info['deviceNumber'] = device_number178 volume_info['deviceNumber'] = device_number
179 volume_info['volumeId'] = volume_id179 volume_info['volumeId'] = volume_id
180180
=== modified file 'nova/virt/xenapi/volumeops.py'
--- nova/virt/xenapi/volumeops.py 2011-01-04 05:23:35 +0000
+++ nova/virt/xenapi/volumeops.py 2011-01-24 15:23:08 +0000
@@ -48,8 +48,8 @@
48 raise exception.NotFound(_('Instance %s not found')48 raise exception.NotFound(_('Instance %s not found')
49 % instance_name)49 % instance_name)
50 # NOTE: No Resource Pool concept so far50 # NOTE: No Resource Pool concept so far
51 LOG.debug(_("Attach_volume: %s, %s, %s"),51 LOG.debug(_("Attach_volume: %(instance_name)s, %(device_path)s,"
52 instance_name, device_path, mountpoint)52 " %(mountpoint)s") % locals())
53 # Create the iSCSI SR, and the PDB through which hosts access SRs.53 # Create the iSCSI SR, and the PDB through which hosts access SRs.
54 # But first, retrieve target info, like Host, IQN, LUN and SCSIID54 # But first, retrieve target info, like Host, IQN, LUN and SCSIID
55 vol_rec = VolumeHelper.parse_volume_info(device_path, mountpoint)55 vol_rec = VolumeHelper.parse_volume_info(device_path, mountpoint)
@@ -66,9 +66,8 @@
66 except StorageError, exc:66 except StorageError, exc:
67 LOG.exception(exc)67 LOG.exception(exc)
68 VolumeHelper.destroy_iscsi_storage(self._session, sr_ref)68 VolumeHelper.destroy_iscsi_storage(self._session, sr_ref)
69 raise Exception(_('Unable to create VDI on SR %s for instance %s')69 raise Exception(_('Unable to create VDI on SR %(sr_ref)s for'
70 % (sr_ref,70 ' instance %(instance_name)s') % locals())
71 instance_name))
72 else:71 else:
73 try:72 try:
74 vbd_ref = VMHelper.create_vbd(self._session,73 vbd_ref = VMHelper.create_vbd(self._session,
@@ -78,9 +77,8 @@
78 except self.XenAPI.Failure, exc:77 except self.XenAPI.Failure, exc:
79 LOG.exception(exc)78 LOG.exception(exc)
80 VolumeHelper.destroy_iscsi_storage(self._session, sr_ref)79 VolumeHelper.destroy_iscsi_storage(self._session, sr_ref)
81 raise Exception(_('Unable to use SR %s for instance %s')80 raise Exception(_('Unable to use SR %(sr_ref)s for'
82 % (sr_ref,81 ' instance %(instance_name)s') % locals())
83 instance_name))
84 else:82 else:
85 try:83 try:
86 task = self._session.call_xenapi('Async.VBD.plug',84 task = self._session.call_xenapi('Async.VBD.plug',
@@ -92,8 +90,8 @@
92 sr_ref)90 sr_ref)
93 raise Exception(_('Unable to attach volume to instance %s')91 raise Exception(_('Unable to attach volume to instance %s')
94 % instance_name)92 % instance_name)
95 LOG.info(_('Mountpoint %s attached to instance %s'),93 LOG.info(_('Mountpoint %(mountpoint)s attached to'
96 mountpoint, instance_name)94 ' instance %(instance_name)s') % locals())
9795
98 def detach_volume(self, instance_name, mountpoint):96 def detach_volume(self, instance_name, mountpoint):
99 """Detach volume storage to VM instance"""97 """Detach volume storage to VM instance"""
@@ -103,7 +101,8 @@
103 raise exception.NotFound(_('Instance %s not found')101 raise exception.NotFound(_('Instance %s not found')
104 % instance_name)102 % instance_name)
105 # Detach VBD from VM103 # Detach VBD from VM
106 LOG.debug(_("Detach_volume: %s, %s"), instance_name, mountpoint)104 LOG.debug(_("Detach_volume: %(instance_name)s, %(mountpoint)s")
105 % locals())
107 device_number = VolumeHelper.mountpoint_to_number(mountpoint)106 device_number = VolumeHelper.mountpoint_to_number(mountpoint)
108 try:107 try:
109 vbd_ref = VMHelper.find_vbd_by_number(self._session,108 vbd_ref = VMHelper.find_vbd_by_number(self._session,
@@ -125,5 +124,5 @@
125 LOG.exception(exc)124 LOG.exception(exc)
126 # Forget SR125 # Forget SR
127 VolumeHelper.destroy_iscsi_storage(self._session, sr_ref)126 VolumeHelper.destroy_iscsi_storage(self._session, sr_ref)
128 LOG.info(_('Mountpoint %s detached from instance %s'),127 LOG.info(_('Mountpoint %(mountpoint)s detached from'
129 mountpoint, instance_name)128 ' instance %(instance_name)s') % locals())
130129
=== modified file 'nova/virt/xenapi_conn.py'
--- nova/virt/xenapi_conn.py 2011-01-21 21:31:47 +0000
+++ nova/virt/xenapi_conn.py 2011-01-24 15:23:08 +0000
@@ -298,19 +298,14 @@
298 return298 return
299 elif status == "success":299 elif status == "success":
300 result = self._session.xenapi.task.get_result(task)300 result = self._session.xenapi.task.get_result(task)
301 LOG.info(_("Task [%s] %s status: success %s") % (301 LOG.info(_("Task [%(name)s] %(task)s status:"
302 name,302 " success %(result)s") % locals())
303 task,
304 result))
305 done.send(_parse_xmlrpc_value(result))303 done.send(_parse_xmlrpc_value(result))
306 else:304 else:
307 error_info = self._session.xenapi.task.get_error_info(task)305 error_info = self._session.xenapi.task.get_error_info(task)
308 action["error"] = str(error_info)306 action["error"] = str(error_info)
309 LOG.warn(_("Task [%s] %s status: %s %s") % (307 LOG.warn(_("Task [%(name)s] %(task)s status:"
310 name,308 " %(status)s %(error_info)s") % locals())
311 task,
312 status,
313 error_info))
314 done.send_exception(self.XenAPI.Failure(error_info))309 done.send_exception(self.XenAPI.Failure(error_info))
315 db.instance_action_create(context.get_admin_context(), action)310 db.instance_action_create(context.get_admin_context(), action)
316 except self.XenAPI.Failure, exc:311 except self.XenAPI.Failure, exc:
317312
=== modified file 'nova/volume/api.py'
--- nova/volume/api.py 2011-01-07 14:46:17 +0000
+++ nova/volume/api.py 2011-01-24 15:23:08 +0000
@@ -41,10 +41,11 @@
4141
42 def create(self, context, size, name, description):42 def create(self, context, size, name, description):
43 if quota.allowed_volumes(context, 1, size) < 1:43 if quota.allowed_volumes(context, 1, size) < 1:
44 LOG.warn(_("Quota exceeeded for %s, tried to create %sG volume"),44 pid = context.project_id
45 context.project_id, size)45 LOG.warn(_("Quota exceeeded for %(pid)s, tried to create"
46 " %(size)sG volume") % locals())
46 raise quota.QuotaError(_("Volume quota exceeded. You cannot "47 raise quota.QuotaError(_("Volume quota exceeded. You cannot "
47 "create a volume of size %s") % size)48 "create a volume of size %s") % size)
4849
49 options = {50 options = {
50 'size': size,51 'size': size,
5152
=== modified file 'nova/volume/manager.py'
--- nova/volume/manager.py 2011-01-19 02:50:21 +0000
+++ nova/volume/manager.py 2011-01-24 15:23:08 +0000
@@ -103,9 +103,10 @@
103 volume_ref['host'] = self.host103 volume_ref['host'] = self.host
104104
105 try:105 try:
106 LOG.debug(_("volume %s: creating lv of size %sG"),106 vol_name = volume_ref['name']
107 volume_ref['name'],107 vol_size = volume_ref['size']
108 volume_ref['size'])108 LOG.debug(_("volume %(vol_name)s: creating lv of"
109 " size %(vol_size)sG") % locals())
109 self.driver.create_volume(volume_ref)110 self.driver.create_volume(volume_ref)
110111
111 LOG.debug(_("volume %s: creating export"), volume_ref['name'])112 LOG.debug(_("volume %s: creating export"), volume_ref['name'])
112113
=== modified file 'nova/wsgi.py'
--- nova/wsgi.py 2011-01-20 17:52:02 +0000
+++ nova/wsgi.py 2011-01-24 15:23:08 +0000
@@ -64,7 +64,8 @@
6464
65 def start(self, application, port, host='0.0.0.0', backlog=128):65 def start(self, application, port, host='0.0.0.0', backlog=128):
66 """Run a WSGI server with the given application."""66 """Run a WSGI server with the given application."""
67 logging.audit(_("Starting %s on %s:%s"), sys.argv[0], host, port)67 arg0 = sys.argv[0]
68 logging.audit(_("Starting %(arg0)s on %(host)s:%(port)s") % locals())
68 socket = eventlet.listen((host, port), backlog=backlog)69 socket = eventlet.listen((host, port), backlog=backlog)
69 self.pool.spawn_n(self._run, application, socket)70 self.pool.spawn_n(self._run, application, socket)
7071