diff options
| author | Ann Kamyshnikova <akamyshnikova@mirantis.com> | 2013-06-25 17:12:58 +0400 |
|---|---|---|
| committer | Ann Kamyshnikova <akamyshnikova@mirantis.com> | 2013-07-10 11:12:25 +0400 |
| commit | 1a2df89c05d33495d7e057dcdf0714d05beb1fc8 (patch) | |
| tree | 60067a5aa95b8801dc3f6190914f7ff654c513ed /openstack/common | |
| parent | dee8afb7f879b729240b9db1fcf345f702b447e4 (diff) | |
| download | oslo-1a2df89c05d33495d7e057dcdf0714d05beb1fc8.tar.gz oslo-1a2df89c05d33495d7e057dcdf0714d05beb1fc8.tar.xz oslo-1a2df89c05d33495d7e057dcdf0714d05beb1fc8.zip | |
Enable H302 hacking check
This change requires hacking >0.5.5
Change-Id: Ic36fa0502548335d433f3fbe663854523dd04397
Diffstat (limited to 'openstack/common')
33 files changed, 40 insertions, 40 deletions
diff --git a/openstack/common/crypto/utils.py b/openstack/common/crypto/utils.py index 61c1a50..ecf38ad 100644 --- a/openstack/common/crypto/utils.py +++ b/openstack/common/crypto/utils.py @@ -19,8 +19,8 @@ import base64 from Crypto.Hash import HMAC from Crypto import Random -from openstack.common.gettextutils import _ -from openstack.common.importutils import import_module +from openstack.common.gettextutils import _ # noqa +from openstack.common import importutils class CryptoutilsException(Exception): @@ -54,7 +54,7 @@ class HKDF(object): """ def __init__(self, hashtype='SHA256'): - self.hashfn = import_module('Crypto.Hash.' + hashtype) + self.hashfn = importutils.import_module('Crypto.Hash.' + hashtype) self.max_okm_length = 255 * self.hashfn.digest_size def extract(self, ikm, salt=None): @@ -107,8 +107,8 @@ class SymmetricCrypto(object): """ def __init__(self, enctype='AES', hashtype='SHA256'): - self.cipher = import_module('Crypto.Cipher.' + enctype) - self.hashfn = import_module('Crypto.Hash.' + hashtype) + self.cipher = importutils.import_module('Crypto.Cipher.' + enctype) + self.hashfn = importutils.import_module('Crypto.Hash.' + hashtype) def new_key(self, size): return Random.new().read(size) diff --git a/openstack/common/db/exception.py b/openstack/common/db/exception.py index 8588d85..69905da 100644 --- a/openstack/common/db/exception.py +++ b/openstack/common/db/exception.py @@ -18,7 +18,7 @@ """DB related custom exceptions.""" -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa class DBError(Exception): diff --git a/openstack/common/db/sqlalchemy/models.py b/openstack/common/db/sqlalchemy/models.py index f61bb39..fb5a3fa 100644 --- a/openstack/common/db/sqlalchemy/models.py +++ b/openstack/common/db/sqlalchemy/models.py @@ -26,7 +26,7 @@ from sqlalchemy import Column, Integer from sqlalchemy import DateTime from sqlalchemy.orm import object_mapper -from openstack.common.db.sqlalchemy.session import get_session +from openstack.common.db.sqlalchemy import session as sa from openstack.common import timeutils @@ -37,7 +37,7 @@ class ModelBase(object): def save(self, session=None): """Save this object.""" if not session: - session = get_session() + session = sa.get_session() # NOTE(boris-42): This part of code should be look like: # sesssion.add(self) # session.flush() diff --git a/openstack/common/db/sqlalchemy/session.py b/openstack/common/db/sqlalchemy/session.py index 7400b17..59bcb90 100644 --- a/openstack/common/db/sqlalchemy/session.py +++ b/openstack/common/db/sqlalchemy/session.py @@ -256,7 +256,7 @@ from sqlalchemy.pool import NullPool, StaticPool from sqlalchemy.sql.expression import literal_column from openstack.common.db import exception -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging from openstack.common import timeutils diff --git a/openstack/common/db/sqlalchemy/utils.py b/openstack/common/db/sqlalchemy/utils.py index e89ec10..07030c5 100644 --- a/openstack/common/db/sqlalchemy/utils.py +++ b/openstack/common/db/sqlalchemy/utils.py @@ -22,7 +22,7 @@ import sqlalchemy -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging diff --git a/openstack/common/deprecated/wsgi.py b/openstack/common/deprecated/wsgi.py index cf2e9ae..a9530b3 100644 --- a/openstack/common/deprecated/wsgi.py +++ b/openstack/common/deprecated/wsgi.py @@ -36,7 +36,7 @@ from xml.dom import minidom from xml.parsers import expat from openstack.common import exception -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import jsonutils from openstack.common import log as logging from openstack.common import service diff --git a/openstack/common/eventlet_backdoor.py b/openstack/common/eventlet_backdoor.py index f2102d6..9d3227c 100644 --- a/openstack/common/eventlet_backdoor.py +++ b/openstack/common/eventlet_backdoor.py @@ -31,7 +31,7 @@ import eventlet.backdoor import greenlet from oslo.config import cfg -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging help_for_backdoor_port = 'Acceptable ' + \ diff --git a/openstack/common/exception.py b/openstack/common/exception.py index f6c8463..fdf17b2 100644 --- a/openstack/common/exception.py +++ b/openstack/common/exception.py @@ -21,7 +21,7 @@ Exceptions common to OpenStack projects import logging -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa _FATAL_EXCEPTION_FORMAT_ERRORS = False diff --git a/openstack/common/excutils.py b/openstack/common/excutils.py index 336e147..abe6f87 100644 --- a/openstack/common/excutils.py +++ b/openstack/common/excutils.py @@ -24,7 +24,7 @@ import sys import time import traceback -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa class save_and_reraise_exception(object): diff --git a/openstack/common/fileutils.py b/openstack/common/fileutils.py index 9f8807f..7a04e8f 100644 --- a/openstack/common/fileutils.py +++ b/openstack/common/fileutils.py @@ -21,7 +21,7 @@ import errno import os from openstack.common import excutils -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/openstack/common/lockutils.py b/openstack/common/lockutils.py index 27525ce..be362f8 100644 --- a/openstack/common/lockutils.py +++ b/openstack/common/lockutils.py @@ -28,7 +28,7 @@ from eventlet import semaphore from oslo.config import cfg from openstack.common import fileutils -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import local from openstack.common import log as logging diff --git a/openstack/common/log.py b/openstack/common/log.py index 0447a52..465886b 100644 --- a/openstack/common/log.py +++ b/openstack/common/log.py @@ -42,7 +42,7 @@ import traceback from oslo.config import cfg -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import importutils from openstack.common import jsonutils from openstack.common import local diff --git a/openstack/common/loopingcall.py b/openstack/common/loopingcall.py index 1688432..71dedd8 100644 --- a/openstack/common/loopingcall.py +++ b/openstack/common/loopingcall.py @@ -22,7 +22,7 @@ import sys from eventlet import event from eventlet import greenthread -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging from openstack.common import timeutils diff --git a/openstack/common/middleware/sizelimit.py b/openstack/common/middleware/sizelimit.py index 96a1fbf..ecbdde1 100644 --- a/openstack/common/middleware/sizelimit.py +++ b/openstack/common/middleware/sizelimit.py @@ -23,7 +23,7 @@ import webob.dec import webob.exc from openstack.common.deprecated import wsgi -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common.middleware import base diff --git a/openstack/common/notifier/api.py b/openstack/common/notifier/api.py index dc4f578..df89f67 100644 --- a/openstack/common/notifier/api.py +++ b/openstack/common/notifier/api.py @@ -19,7 +19,7 @@ import uuid from oslo.config import cfg from openstack.common import context -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import importutils from openstack.common import jsonutils from openstack.common import log as logging diff --git a/openstack/common/notifier/rpc_notifier.py b/openstack/common/notifier/rpc_notifier.py index 17bbc9a..6bfc333 100644 --- a/openstack/common/notifier/rpc_notifier.py +++ b/openstack/common/notifier/rpc_notifier.py @@ -16,7 +16,7 @@ from oslo.config import cfg from openstack.common import context as req_context -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging from openstack.common import rpc diff --git a/openstack/common/notifier/rpc_notifier2.py b/openstack/common/notifier/rpc_notifier2.py index 38fe33b..55dd780 100644 --- a/openstack/common/notifier/rpc_notifier2.py +++ b/openstack/common/notifier/rpc_notifier2.py @@ -18,7 +18,7 @@ from oslo.config import cfg from openstack.common import context as req_context -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging from openstack.common import rpc diff --git a/openstack/common/periodic_task.py b/openstack/common/periodic_task.py index 4fbb0fe..1c19846 100644 --- a/openstack/common/periodic_task.py +++ b/openstack/common/periodic_task.py @@ -18,7 +18,7 @@ import time from oslo.config import cfg -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging from openstack.common import timeutils diff --git a/openstack/common/policy.py b/openstack/common/policy.py index 40e5a6e..d4d9aa1 100644 --- a/openstack/common/policy.py +++ b/openstack/common/policy.py @@ -65,7 +65,7 @@ from oslo.config import cfg import six from openstack.common import fileutils -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import jsonutils from openstack.common import log as logging diff --git a/openstack/common/processutils.py b/openstack/common/processutils.py index 5417055..13f6222 100644 --- a/openstack/common/processutils.py +++ b/openstack/common/processutils.py @@ -27,7 +27,7 @@ import signal from eventlet.green import subprocess from eventlet import greenthread -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging diff --git a/openstack/common/rpc/__init__.py b/openstack/common/rpc/__init__.py index 325c036..e39f294 100644 --- a/openstack/common/rpc/__init__.py +++ b/openstack/common/rpc/__init__.py @@ -29,7 +29,7 @@ import inspect from oslo.config import cfg -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import importutils from openstack.common import local from openstack.common import log as logging diff --git a/openstack/common/rpc/amqp.py b/openstack/common/rpc/amqp.py index c3e4e26..23e0079 100644 --- a/openstack/common/rpc/amqp.py +++ b/openstack/common/rpc/amqp.py @@ -36,7 +36,7 @@ from eventlet import queue from eventlet import semaphore from openstack.common import excutils -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import local from openstack.common import log as logging from openstack.common.rpc import common as rpc_common diff --git a/openstack/common/rpc/common.py b/openstack/common/rpc/common.py index e116e92..0d85488 100644 --- a/openstack/common/rpc/common.py +++ b/openstack/common/rpc/common.py @@ -24,7 +24,7 @@ import traceback from oslo.config import cfg import six -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import importutils from openstack.common import jsonutils from openstack.common import local diff --git a/openstack/common/rpc/impl_kombu.py b/openstack/common/rpc/impl_kombu.py index d1d04e0..67022ea 100644 --- a/openstack/common/rpc/impl_kombu.py +++ b/openstack/common/rpc/impl_kombu.py @@ -30,7 +30,7 @@ import kombu.messaging from oslo.config import cfg from openstack.common import excutils -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import network_utils from openstack.common.rpc import amqp as rpc_amqp from openstack.common.rpc import common as rpc_common diff --git a/openstack/common/rpc/impl_qpid.py b/openstack/common/rpc/impl_qpid.py index c988ae8..dbfbdde 100644 --- a/openstack/common/rpc/impl_qpid.py +++ b/openstack/common/rpc/impl_qpid.py @@ -25,7 +25,7 @@ import greenlet from oslo.config import cfg from openstack.common import excutils -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import importutils from openstack.common import jsonutils from openstack.common import log as logging diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py index fb8fcd2..33d5cb6 100644 --- a/openstack/common/rpc/impl_zmq.py +++ b/openstack/common/rpc/impl_zmq.py @@ -27,7 +27,7 @@ import greenlet from oslo.config import cfg from openstack.common import excutils -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import importutils from openstack.common import jsonutils from openstack.common.rpc import common as rpc_common diff --git a/openstack/common/rpc/matchmaker.py b/openstack/common/rpc/matchmaker.py index e51636d..e80ab37 100644 --- a/openstack/common/rpc/matchmaker.py +++ b/openstack/common/rpc/matchmaker.py @@ -23,7 +23,7 @@ import contextlib import eventlet from oslo.config import cfg -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging diff --git a/openstack/common/rpc/matchmaker_ring.py b/openstack/common/rpc/matchmaker_ring.py index 2f1f79b..45a095f 100644 --- a/openstack/common/rpc/matchmaker_ring.py +++ b/openstack/common/rpc/matchmaker_ring.py @@ -23,7 +23,7 @@ import json from oslo.config import cfg -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging from openstack.common.rpc import matchmaker as mm diff --git a/openstack/common/rpc/service.py b/openstack/common/rpc/service.py index 3f51d0b..e60cd1f 100644 --- a/openstack/common/rpc/service.py +++ b/openstack/common/rpc/service.py @@ -17,7 +17,7 @@ # License for the specific language governing permissions and limitations # under the License. -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import log as logging from openstack.common import rpc from openstack.common.rpc import dispatcher as rpc_dispatcher diff --git a/openstack/common/service.py b/openstack/common/service.py index d5c5604..24ab5e9 100644 --- a/openstack/common/service.py +++ b/openstack/common/service.py @@ -32,7 +32,7 @@ import logging as std_logging from oslo.config import cfg from openstack.common import eventlet_backdoor -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa from openstack.common import importutils from openstack.common import log as logging from openstack.common import threadgroup diff --git a/openstack/common/sslutils.py b/openstack/common/sslutils.py index 252da72..23f8bbf 100644 --- a/openstack/common/sslutils.py +++ b/openstack/common/sslutils.py @@ -19,7 +19,7 @@ import ssl from oslo.config import cfg -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa ssl_opts = [ diff --git a/openstack/common/strutils.py b/openstack/common/strutils.py index 0ba9b44..971ffe3 100644 --- a/openstack/common/strutils.py +++ b/openstack/common/strutils.py @@ -25,7 +25,7 @@ import unicodedata import six -from openstack.common.gettextutils import _ +from openstack.common.gettextutils import _ # noqa # Used for looking up extensions of text diff --git a/openstack/common/threadgroup.py b/openstack/common/threadgroup.py index 877059c..6d1afe7 100644 --- a/openstack/common/threadgroup.py +++ b/openstack/common/threadgroup.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -from eventlet import greenlet +import eventlet from eventlet import greenpool from eventlet import greenthread @@ -105,7 +105,7 @@ class ThreadGroup(object): for x in self.timers: try: x.wait() - except greenlet.GreenletExit: + except eventlet.greenlet.GreenletExit: pass except Exception as ex: LOG.exception(ex) @@ -115,7 +115,7 @@ class ThreadGroup(object): continue try: x.wait() - except greenlet.GreenletExit: + except eventlet.greenlet.GreenletExit: pass except Exception as ex: LOG.exception(ex) |
