summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-03 16:19:10 +0000
committerGerrit Code Review <review@openstack.org>2013-06-03 16:19:10 +0000
commit4b90bc5c314fa52ece212451fbfec7ba7eced3b1 (patch)
tree785a0f9a031b3da490d1ae2351a4bf561be8fa2a
parent795d253d4ae5d9fdf4aea8ba03e2b73a24ded2a7 (diff)
parent6f27af4a0cdbde42b1566ecabaf667c26b089dc3 (diff)
downloadpython-keystoneclient-0.2.5.tar.gz
Merge "Fix unused imports(flake8 F401, F999)"0.2.5
-rw-r--r--keystoneclient/client.py4
-rw-r--r--keystoneclient/common/cms.py2
-rw-r--r--keystoneclient/v2_0/__init__.py1
-rw-r--r--keystoneclient/v2_0/client.py16
-rw-r--r--keystoneclient/v3/__init__.py1
-rw-r--r--keystoneclient/v3/client.py7
-rw-r--r--tests/test_base.py4
-rw-r--r--tests/test_client.py1
-rw-r--r--tests/test_shell.py1
-rw-r--r--tests/v2_0/fakes.py3
-rw-r--r--tests/v2_0/test_shell.py3
-rw-r--r--tests/v3/test_endpoints.py1
-rw-r--r--tools/install_venv.py1
-rw-r--r--tox.ini4
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 1ccd818..86d46c1 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
diff --git a/tox.ini b/tox.ini
index d211a0a..421fa86 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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