From bd9c27914b246ce05de44aa0cd3540632aff2571 Mon Sep 17 00:00:00 2001 From: vponomaryov Date: Mon, 7 Jul 2014 17:48:35 +0300 Subject: [PATCH] Fix and enable H102 pep8 rule (apache license header) Related-Bug: #1333290 Change-Id: I8c8794b06c604be36e632308e8c8c85aed6065ec --- manilaclient/client.py | 14 +++++++++++++- manilaclient/exceptions.py | 14 ++++++++++++++ manilaclient/utils.py | 12 ++++++++++++ manilaclient/v1/client.py | 12 ++++++++++++ manilaclient/v1/limits.py | 13 +++++++++++++ tests/fakes.py | 12 ++++++++++++ tests/test_base.py | 12 ++++++++++++ tests/test_client.py | 11 +++++++++++ tests/test_http.py | 13 ++++++++++++- tests/test_service_catalog.py | 12 ++++++++++++ tests/test_shell.py | 12 ++++++++++++ tests/test_utils.py | 11 +++++++++++ tests/utils.py | 12 ++++++++++++ tox.ini | 2 +- 14 files changed, 159 insertions(+), 3 deletions(-) diff --git a/manilaclient/client.py b/manilaclient/client.py index bfc1d66c9..8e019f7c6 100644 --- a/manilaclient/client.py +++ b/manilaclient/client.py @@ -1,8 +1,20 @@ # Copyright 2010 Jacob Kaplan-Moss # Copyright 2011 OpenStack LLC. # Copyright 2011 Piston Cloud Computing, Inc. - # All Rights Reserved. +# +# 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. + """ OpenStack Client interface. Handles the REST calls and responses. """ diff --git a/manilaclient/exceptions.py b/manilaclient/exceptions.py index 745fa1cfc..2bfb65ab9 100644 --- a/manilaclient/exceptions.py +++ b/manilaclient/exceptions.py @@ -1,4 +1,18 @@ # Copyright 2010 Jacob Kaplan-Moss +# All Rights Reserved. +# +# 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. + """ Exception definitions. """ diff --git a/manilaclient/utils.py b/manilaclient/utils.py index ec629cc94..578ed72cf 100644 --- a/manilaclient/utils.py +++ b/manilaclient/utils.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. + from __future__ import print_function import os diff --git a/manilaclient/v1/client.py b/manilaclient/v1/client.py index 7b9c83cc3..9309c35ad 100644 --- a/manilaclient/v1/client.py +++ b/manilaclient/v1/client.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. + from manilaclient import client from manilaclient.v1 import limits from manilaclient.v1 import quota_classes diff --git a/manilaclient/v1/limits.py b/manilaclient/v1/limits.py index 50c5a5ebe..c32b946bb 100644 --- a/manilaclient/v1/limits.py +++ b/manilaclient/v1/limits.py @@ -1,4 +1,17 @@ # Copyright 2013 OpenStack LLC. +# All Rights Reserved. +# +# 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. from manilaclient import base diff --git a/tests/fakes.py b/tests/fakes.py index 4fe6b2908..1ac8b2787 100644 --- a/tests/fakes.py +++ b/tests/fakes.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. + """ A fake server that "responds" to API methods with pre-canned responses. diff --git a/tests/test_base.py b/tests/test_base.py index 686a5d349..ac4de8481 100644 --- a/tests/test_base.py +++ b/tests/test_base.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. + from manilaclient import base from manilaclient import exceptions from manilaclient.v1 import shares diff --git a/tests/test_client.py b/tests/test_client.py index cbc616fbf..39380c298 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,3 +1,14 @@ +# 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 manilaclient.client import manilaclient.v1.client diff --git a/tests/test_http.py b/tests/test_http.py index 722de5f09..c21fc950c 100644 --- a/tests/test_http.py +++ b/tests/test_http.py @@ -1,5 +1,16 @@ -import mock +# 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 mock import requests from manilaclient import client diff --git a/tests/test_service_catalog.py b/tests/test_service_catalog.py index 03103b813..4bcebdacc 100644 --- a/tests/test_service_catalog.py +++ b/tests/test_service_catalog.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. + from manilaclient import exceptions from manilaclient import service_catalog from tests import utils diff --git a/tests/test_shell.py b/tests/test_shell.py index 40cf06472..1ad252957 100644 --- a/tests/test_shell.py +++ b/tests/test_shell.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 re import sys diff --git a/tests/test_utils.py b/tests/test_utils.py index 41ec61a9a..73ea5458e 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,3 +1,14 @@ +# 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. from manilaclient import base from manilaclient import exceptions diff --git a/tests/utils.py b/tests/utils.py index 61a4e529a..3efe70b8a 100644 --- a/tests/utils.py +++ b/tests/utils.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 os import fixtures diff --git a/tox.ini b/tox.ini index d3fbed5b5..d3960ba75 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}' downloadcache = ~/cache/pip [flake8] -ignore = H102,F811,F821 +ignore = F811,F821 builtins = _ exclude = .venv,.tox,dist,doc,openstack,*egg