]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
cinder.api: Replace 'locals()' with explicit values
authorScott DAngelo <scott.dangelo@hp.com>
Wed, 10 Jul 2013 22:00:02 +0000 (22:00 +0000)
committerScott DAngelo <scott.dangelo@hp.com>
Wed, 10 Jul 2013 22:03:08 +0000 (22:03 +0000)
    Help bring source code into compliance with the
    Cinder Style Commandments:
    https://github.com/openstack/cinder/blob/master/HACKING.rst

    This change covers all affected source in the
    cinder api module, specifically:
    cinder/api/contrib/volume_actions.py

    Partially fixes: bug #1190758

Change-Id: I2134e69b70a5a5132847168f60b4d192bdf0b536

cinder/api/contrib/volume_actions.py

index ede1b70489bff34610525557178680330c410e1d..63d45246b935756b2a564e6ca75fe28f5c02fda0 100644 (file)
@@ -89,7 +89,10 @@ class VolumeActionsController(wsgi.Controller):
         if instance_uuid and host_name:
             msg = _("Invalid request to attach volume to an "
                     "instance %(instance_uuid)s and a "
-                    "host %(host_name)s simultaneously") % (locals())
+                    "host %(host_name)s simultaneously") % {
+                        'instance_uuid': instance_uuid,
+                        'host_name': host_name,
+                    }
             raise webob.exc.HTTPBadRequest(explanation=msg)
         elif instance_uuid is None and host_name is None:
             msg = _("Invalid request to attach volume to an invalid target")