diff options
author | Dolph Mathews <dolph.mathews@gmail.com> | 2013-05-28 09:22:03 -0500 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-06-03 13:05:12 +0000 |
commit | 6f27af4a0cdbde42b1566ecabaf667c26b089dc3 (patch) | |
tree | b5113ad5410764c0a8279d84ad89975192973954 | |
parent | abcf9db6251a2e1349ee199113cc80a136ff2f79 (diff) | |
download | python-keystoneclient-6f27af4a0cdbde42b1566ecabaf667c26b089dc3.tar.gz |
Fix unused imports(flake8 F401, F999)
- F401: imported but unused
- F999: syntax error in doctest
Fixing a couple of the F401's simply required fixing the doctests syntax
where the imports were actually in use.
Change-Id: If78abbb143daf8d005a71c5ab52836df29c5e0cd
-rw-r--r-- | keystoneclient/client.py | 4 | ||||
-rw-r--r-- | keystoneclient/common/cms.py | 2 | ||||
-rw-r--r-- | keystoneclient/v2_0/__init__.py | 1 | ||||
-rw-r--r-- | keystoneclient/v2_0/client.py | 16 | ||||
-rw-r--r-- | keystoneclient/v3/__init__.py | 1 | ||||
-rw-r--r-- | keystoneclient/v3/client.py | 7 | ||||
-rw-r--r-- | tests/test_base.py | 4 | ||||
-rw-r--r-- | tests/test_client.py | 1 | ||||
-rw-r--r-- | tests/test_shell.py | 1 | ||||
-rw-r--r-- | tests/v2_0/fakes.py | 3 | ||||
-rw-r--r-- | tests/v2_0/test_shell.py | 3 | ||||
-rw-r--r-- | tests/v3/test_endpoints.py | 1 | ||||
-rw-r--r-- | tools/install_venv.py | 1 | ||||
-rw-r--r-- | tox.ini | 4 |
14 files changed, 18 insertions, 31 deletions
diff --git a/keystoneclient/client.py b/keystoneclient/client.py index 8e5e2bd..5b2f125 100644 --- a/keystoneclient/client.py +++ b/keystoneclient/client.py @@ -35,8 +35,8 @@ _logger = logging.getLogger(__name__) def try_import_keyring(): try: - import keyring - import pickle + import keyring # noqa + import pickle # noqa return True except ImportError: if (hasattr(sys.stderr, 'isatty') and sys.stderr.isatty()): diff --git a/keystoneclient/common/cms.py b/keystoneclient/common/cms.py index f13264d..48b991a 100644 --- a/keystoneclient/common/cms.py +++ b/keystoneclient/common/cms.py @@ -21,7 +21,7 @@ def _ensure_subprocess(): else: import subprocess except ImportError: - import subprocess + import subprocess # noqa def cms_verify(formatted, signing_cert_file_name, ca_file_name): diff --git a/keystoneclient/v2_0/__init__.py b/keystoneclient/v2_0/__init__.py index 44ad28e..00ff0c1 100644 --- a/keystoneclient/v2_0/__init__.py +++ b/keystoneclient/v2_0/__init__.py @@ -1 +1,2 @@ +# flake8: noqa from keystoneclient.v2_0.client import Client diff --git a/keystoneclient/v2_0/client.py b/keystoneclient/v2_0/client.py index 03cb8f2..788bfa7 100644 --- a/keystoneclient/v2_0/client.py +++ b/keystoneclient/v2_0/client.py @@ -80,9 +80,9 @@ class Client(client.HTTPClient): >>> from keystoneclient.v2_0 import client >>> keystone = client.Client(username=USER, - password=PASS, - tenant_name=TENANT_NAME, - auth_url=KEYSTONE_URL) + ... password=PASS, + ... tenant_name=TENANT_NAME, + ... auth_url=KEYSTONE_URL) >>> keystone.tenants.list() ... >>> user = keystone.users.get(USER_ID) @@ -95,9 +95,9 @@ class Client(client.HTTPClient): >>> from keystoneclient.v2_0 import client >>> keystone = client.Client(username=USER, - password=PASS, - tenant_name=TENANT_NAME, - auth_url=KEYSTONE_URL) + ... password=PASS, + ... tenant_name=TENANT_NAME, + ... auth_url=KEYSTONE_URL) >>> auth_ref = keystone.auth_ref >>> # pickle or whatever you like here >>> new_client = client.Client(auth_ref=auth_ref) @@ -111,8 +111,8 @@ class Client(client.HTTPClient): >>> from keystoneclient.v2_0 import client >>> admin_client = client.Client( - token='12345secret7890', - endpoint='http://localhost:35357/v2.0') + ... token='12345secret7890', + ... endpoint='http://localhost:35357/v2.0') >>> keystone.tenants.list() """ diff --git a/keystoneclient/v3/__init__.py b/keystoneclient/v3/__init__.py index feb2536..82919ad 100644 --- a/keystoneclient/v3/__init__.py +++ b/keystoneclient/v3/__init__.py @@ -1 +1,2 @@ +# flake8: noqa from keystoneclient.v3.client import Client diff --git a/keystoneclient/v3/client.py b/keystoneclient/v3/client.py index f8d860c..c0b613e 100644 --- a/keystoneclient/v3/client.py +++ b/keystoneclient/v3/client.py @@ -52,9 +52,10 @@ class Client(client.Client): >>> from keystoneclient.v3 import client >>> keystone = client.Client(username=USER, - password=PASS, - tenant_name=TENANT_NAME, - auth_url=KEYSTONE_URL) + ... password=PASS, + ... tenant_name=TENANT_NAME, + ... auth_url=KEYSTONE_URL) + ... >>> keystone.tenants.list() ... >>> user = keystone.users.get(USER_ID) diff --git a/tests/test_base.py b/tests/test_base.py index e28b651..42d591a 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,8 +1,4 @@ -import mock -import mox - from keystoneclient import base -from keystoneclient import exceptions from keystoneclient.v2_0 import roles from tests import utils diff --git a/tests/test_client.py b/tests/test_client.py index 90ab346..d24d72a 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,4 +1,3 @@ -import copy import json import mock diff --git a/tests/test_shell.py b/tests/test_shell.py index f16be85..502c708 100644 --- a/tests/test_shell.py +++ b/tests/test_shell.py @@ -2,7 +2,6 @@ import argparse import cStringIO import json import os -import requests import sys import uuid diff --git a/tests/v2_0/fakes.py b/tests/v2_0/fakes.py index 47d398c..8152322 100644 --- a/tests/v2_0/fakes.py +++ b/tests/v2_0/fakes.py @@ -13,11 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from datetime import datetime import urlparse -from keystoneclient import client as base_client -from keystoneclient.v2_0 import client from tests import fakes from tests import utils diff --git a/tests/v2_0/test_shell.py b/tests/v2_0/test_shell.py index f5c04ec..f097a9c 100644 --- a/tests/v2_0/test_shell.py +++ b/tests/v2_0/test_shell.py @@ -1,13 +1,10 @@ import cStringIO -import mock import os import stubout import sys from testtools import matchers -from keystoneclient import exceptions from keystoneclient import client -from keystoneclient.v2_0 import client as client_v2_0 from tests.v2_0 import fakes from tests import utils diff --git a/tests/v3/test_endpoints.py b/tests/v3/test_endpoints.py index 29bf226..c29499f 100644 --- a/tests/v3/test_endpoints.py +++ b/tests/v3/test_endpoints.py @@ -1,4 +1,3 @@ -import testtools import uuid from keystoneclient.v3 import endpoints diff --git a/tools/install_venv.py b/tools/install_venv.py index 6d6d2b3..f2f8806 100644 --- a/tools/install_venv.py +++ b/tools/install_venv.py @@ -24,7 +24,6 @@ Installation script for python-keystoneclient's development virtualenv """ import os -import subprocess import sys import install_venv_common as install_venv @@ -27,11 +27,9 @@ commands = python setup.py testr --coverage --testr-args='{posargs}' downloadcache = ~/cache/pip [flake8] -# F401: imported but unused # F811: redefinition of unused 'client' from line 81 # F821: undefined name # F841: local variable is assigned to but never used -# F999: syntax error in doctest # H201: no 'except:' at least use 'except Exception:' # H202: assertRaises Exception too broad # H302: import only modules @@ -42,6 +40,6 @@ downloadcache = ~/cache/pip # H403: multi line docstring end on new line # H404: multi line docstring should start with a summary # H802: git commit title -ignore = F401,F811,F821,F841,F999,H201,H202,H302,H304,H306,H401,H402,H403,H404,H802 +ignore = F811,F821,F841,H201,H202,H302,H304,H306,H401,H402,H403,H404,H802 show-source = True exclude = .venv,.tox,dist,doc,*egg |