From 01fc8749851d51139f095b44855045a059b4dc50 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 20 Jul 2013 01:14:44 +0200 Subject: [PATCH] Fix further Hacking 0.6.x warnings * Add missing Apache license header * Avoid using locals() in string formatting Change-Id: Ib9fa878babae5c50bc77e48c62b33a8ebfe39f7f --- cinder/image/image_utils.py | 4 ++-- cinder/tests/api/contrib/test_admin_actions.py | 12 ++++++++++++ cinder/tests/api/openstack/test_wsgi.py | 12 ++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/cinder/image/image_utils.py b/cinder/image/image_utils.py index af6f887da..a212ed626 100644 --- a/cinder/image/image_utils.py +++ b/cinder/image/image_utils.py @@ -228,8 +228,8 @@ def fetch_verify_image(context, image_service, image_id, dest, if backing_file is not None: raise exception.ImageUnacceptable( image_id=image_id, - reason=_("fmt=%(fmt)s backed by:" - "%(backing_file)s") % locals()) + reason=(_("fmt=%(fmt)s backed by: %(backing_file)s") % + {'fmt': fmt, 'backing_file': backing_file})) def fetch_to_raw(context, image_service, diff --git a/cinder/tests/api/contrib/test_admin_actions.py b/cinder/tests/api/contrib/test_admin_actions.py index 80e53d7d3..ef4878c56 100644 --- a/cinder/tests/api/contrib/test_admin_actions.py +++ b/cinder/tests/api/contrib/test_admin_actions.py @@ -1,3 +1,15 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import shutil import tempfile import webob diff --git a/cinder/tests/api/openstack/test_wsgi.py b/cinder/tests/api/openstack/test_wsgi.py index 77308602d..75e0fa215 100644 --- a/cinder/tests/api/openstack/test_wsgi.py +++ b/cinder/tests/api/openstack/test_wsgi.py @@ -1,5 +1,17 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import inspect import webob -- 2.45.2