Fix H307 violations and re-enable gating

H307 is a new rule in hacking 0.9, so fix new violations and
re-enable gating.

Change-Id: I805d10427ebeaee36589936f77a2cf0932c1378e
This commit is contained in:
Igor Degtiarov 2014-06-27 11:47:12 +03:00
parent 303a1ce704
commit 2d153aa8b4
21 changed files with 24 additions and 42 deletions

View File

@ -19,16 +19,17 @@
import abc
import croniter
import datetime
import pytz
from ceilometerclient import client as ceiloclient
from oslo.config import cfg
import pytz
import six
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils
LOG = log.getLogger(__name__)
UNKNOWN = 'insufficient data'

View File

@ -19,7 +19,7 @@
import eventlet
from oslo.config import cfg
import requests
from six.moves.urllib import parse as urlparse
import six.moves.urllib.parse as urlparse
from ceilometer.alarm import notifier
from ceilometer.openstack.common.gettextutils import _

View File

@ -28,8 +28,6 @@ import eventlet
# first read() or select(), thread need to be patched too, because
# oslo.messaging use threading.local
eventlet.monkey_patch(socket=True, select=True, thread=True)
from oslo.config import cfg
from ceilometer.alarm import service as alarm_service
@ -48,6 +46,7 @@ from ceilometer import service
from ceilometer import storage
from ceilometer import transformer
OPTS = [
cfg.StrOpt('evaluation_service',
default='ceilometer.alarm.service.SingletonAlarmService',

View File

@ -17,27 +17,24 @@
import sys
from nova.compute import flavors
from nova import conductor
from nova import notifications
from nova.openstack.common import log as logging
from nova.openstack.common.notifier import api as notifier_api
from nova import utils
from stevedore import extension
# HACK(dhellmann): Insert the nova version of openstack.common into
# sys.modules as though it was the copy from ceilometer, so that when
# we use modules from ceilometer below they do not re-define options.
# use the real ceilometer base package
import ceilometer # noqa
for name in ['openstack', 'openstack.common', 'openstack.common.log']:
sys.modules['ceilometer.' + name] = sys.modules['nova.' + name]
from nova.compute import flavors
from nova import conductor
from nova import utils
from stevedore import extension
from ceilometer.compute.virt import inspector
from ceilometer.openstack.common.gettextutils import _
for name in ['openstack', 'openstack.common', 'openstack.common.log']:
sys.modules['ceilometer.' + name] = sys.modules['nova.' + name]
# This module runs inside the nova compute
# agent, which only configures the "nova" logger.

View File

@ -16,9 +16,9 @@
# under the License.
import abc
import six
from oslo.config import cfg
import six
from stevedore import named
from ceilometer.openstack.common.gettextutils import _

View File

@ -15,14 +15,14 @@
# License for the specific language governing permissions and limitations
# under the License.
from stevedore import extension
from ceilometer.openstack.common import context as req_context
from ceilometer.openstack.common.gettextutils import _
from ceilometer.openstack.common import log as logging
from ceilometer import pipeline
from ceilometer import transformer
from ceilometer.openstack.common.gettextutils import _
from stevedore import extension
LOG = logging.getLogger(__name__)

View File

@ -21,7 +21,7 @@ from __future__ import absolute_import
from keystoneclient import exceptions
from oslo.config import cfg
from six.moves.urllib import parse as urlparse
import six.moves.urllib.parse as urlparse
from swiftclient import client as swift
from ceilometer.central import plugin

View File

@ -24,7 +24,7 @@ import operator
from oslo.config import cfg
import oslo.messaging
import oslo.messaging._drivers.common
from six.moves.urllib import parse as urlparse
import six.moves.urllib.parse as urlparse
from ceilometer import messaging
from ceilometer.openstack.common.gettextutils import _

View File

@ -19,7 +19,7 @@
from oslo.config import cfg
import six
from six.moves.urllib import parse as urlparse
import six.moves.urllib.parse as urlparse
from stevedore import driver
from ceilometer.openstack.common.gettextutils import _

View File

@ -29,9 +29,8 @@ import uuid
import bson.code
import bson.objectid
import pymongo
from oslo.config import cfg
import pymongo
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils

View File

@ -17,7 +17,7 @@
import mock
import requests
from six.moves.urllib import parse as urlparse
import six.moves.urllib.parse as urlparse
from ceilometer.alarm import service
from ceilometer.openstack.common import context

View File

@ -17,8 +17,6 @@
"""Tests for ceilometer.alarm.service.SingletonAlarmService.
"""
import mock
from stevedore import extension
from ceilometer.alarm import service

View File

@ -19,11 +19,10 @@
"""
import functools
import os.path
import six
import eventlet
import oslo.messaging
import oslo.messaging.conffixture
import six
from testtools import testcase
from ceilometer import messaging
@ -52,12 +51,6 @@ class BaseTestCase(test.BaseTestCase):
'ceilometer.messaging.get_transport',
return_value=self.transport))
def setUp(self):
super(BaseTestCase, self).setUp()
self.useFixture(mockpatch.Patch(
'oslo.config.cfg._get_config_dirs',
return_value=[self.path_get('etc/ceilometer')]))
def assertTimestampEqual(self, first, second, msg=None):
"""Checks that two timestamps are equals.

View File

@ -17,7 +17,6 @@ Tests for VMware Vsphere inspector.
"""
import mock
from oslo.vmware import api
from ceilometer.compute.virt import inspector as virt_inspector

View File

@ -17,7 +17,6 @@
"""Tests for Ceilometer notify daemon."""
import mock
from oslo.config import cfg
import oslo.messaging
from stevedore import extension

View File

@ -16,9 +16,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import six
import mock
try:
# Swift >= 1.7.5
import swift.common.swob

View File

@ -17,6 +17,7 @@ import datetime
import mock
from oslo.config import cfg
from ceilometer.openstack.common import log
from ceilometer.openstack.common import test
from ceilometer.orchestration import notifications
from ceilometer import sample
@ -38,7 +39,6 @@ STACK_ARN = u'arn:openstack:heat::%s:stacks/%s/%s' % (TENANT_ID,
CONF = cfg.CONF
CONF.set_override('use_stderr', True)
from ceilometer.openstack.common import log
LOG = log.getLogger(__name__)

View File

@ -31,7 +31,6 @@ from ceilometer.openstack.common import timeutils
from ceilometer.storage import impl_sqlalchemy
from ceilometer.storage import models
from ceilometer.storage.sqlalchemy import models as sql_models
from ceilometer.tests import base as test_base
from ceilometer.tests import db as tests_db
from ceilometer.tests.storage import test_storage_scenarios as scenarios

View File

@ -18,7 +18,6 @@
import eventlet
import mock
import oslo.messaging
import oslo.messaging.conffixture
from stevedore import extension

View File

@ -16,8 +16,8 @@
# under the License.
import abc
import six
import six
from stevedore import extension

View File

@ -38,10 +38,9 @@ commands = {posargs}
[flake8]
# H305 imports not grouped correctly
# H307 like imports should be grouped together
# H405 multi line docstring summary not separated with an empty line
# H904 Wrap long lines in parentheses instead of a backslash
ignore = H305,H307,H405,H904
ignore = H305,H405,H904
builtins = _
exclude=.venv,.git,.tox,dist,doc,./ceilometer/openstack/common,*lib/python*,*egg,tools,nova_tests,build
show-source = True