Enable H407,H305,H307,E122 ignore E123

After bumping the hacking version to the 0.9.x series ignores were
added for several rules. This commit fixes the violations for a subset
of these rules and re-enables the checks.

E123 is ignored because this rule is ignored in the default pep8 by
default, due to a lack of consensus around it.

Change-Id: I8f14cd2ca6afc38d3fe8ee758272071111022896
This commit is contained in:
Matthew Treinish 2014-06-09 18:37:19 -04:00
parent fceab11864
commit 96e9e88dc0
51 changed files with 80 additions and 47 deletions

View File

@ -15,9 +15,9 @@
import base64
import logging
import urlparse
import testtools
import urlparse
from tempest.api.compute import base
from tempest.common.utils import data_utils

View File

@ -14,9 +14,9 @@
# under the License.
import logging
import urlparse
import testtools
import urlparse
from tempest.api.compute import base
from tempest.common.utils import data_utils

View File

@ -13,11 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from testtools import matchers
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest import config
from tempest import test
from testtools import matchers
CONF = config.CONF

View File

@ -12,6 +12,7 @@
import datetime
import re
from tempest.api.identity import base
from tempest import auth
from tempest import clients

View File

@ -17,10 +17,11 @@ import cStringIO as StringIO
import hashlib
import random
import re
import six
import time
import zlib
import six
from tempest.api.object_storage import base
from tempest.common import custom_matchers
from tempest.common.utils import data_utils

View File

@ -11,6 +11,7 @@
# under the License.
import os.path
import yaml
from tempest import clients

View File

@ -12,6 +12,7 @@
import logging
import netaddr
from tempest.api.orchestration import base

View File

@ -56,10 +56,10 @@ class NovaKeyPairResourcesYAMLTest(base.BaseOrchestrationTest):
ext=self._tpl_type)
resources = [('KeyPairSavePrivate',
nova_keypair_template[self._resource][
'KeyPairSavePrivate'][self._type]),
'KeyPairSavePrivate'][self._type]),
('KeyPairDontSavePrivate',
nova_keypair_template[self._resource][
'KeyPairDontSavePrivate'][self._type])]
'KeyPairDontSavePrivate'][self._type])]
for resource_name, resource_type in resources:
resource = self.test_resources.get(resource_name, None)

View File

@ -14,6 +14,7 @@
# limitations under the License.
import logging
from six import moves
from testtools import matchers

View File

@ -15,11 +15,12 @@
# under the License.
import operator
from testtools import matchers
from tempest.api.volume import base
from tempest.common.utils import data_utils
from tempest.openstack.common import log as logging
from tempest import test
from testtools import matchers
LOG = logging.getLogger(__name__)

View File

@ -13,8 +13,10 @@
# under the License.
import copy
from tempest.api_schema.response.compute import hypervisors
hypervisors_servers = copy.deepcopy(hypervisors.common_hypervisors_detail)
# Defining extra attributes for V3 show hypervisor schema

View File

@ -13,8 +13,10 @@
# under the License.
import copy
from tempest.api_schema.response.compute import hypervisors
list_hypervisors_detail = copy.deepcopy(
hypervisors.common_list_hypervisors_detail)
# Defining extra attributes for V3 show hypervisor schema

View File

@ -55,9 +55,7 @@ addresses_v3['patternProperties']['^[a-zA-Z0-9-_.]+$']['items'][
'mac_addr': {'type': 'string'}
})
addresses_v3['patternProperties']['^[a-zA-Z0-9-_.]+$']['items'][
'required'].extend(
['type', 'mac_addr']
)
'required'].extend(['type', 'mac_addr'])
update_server = copy.deepcopy(servers.base_update_get_server)
update_server['response_body']['properties']['server']['properties'].update({

View File

@ -18,16 +18,17 @@ import copy
import datetime
import exceptions
import re
import six
import urlparse
import six
from tempest import config
from tempest.openstack.common import log as logging
from tempest.services.identity.json import identity_client as json_id
from tempest.services.identity.v3.json import identity_client as json_v3id
from tempest.services.identity.v3.xml import identity_client as xml_v3id
from tempest.services.identity.xml import identity_client as xml_id
from tempest.openstack.common import log as logging
CONF = config.CONF
LOG = logging.getLogger(__name__)

View File

@ -15,6 +15,7 @@
import logging
import re
import testtools
from tempest import cli

View File

@ -12,6 +12,7 @@
import json
import os
import yaml
import tempest.cli

View File

@ -19,13 +19,13 @@ resources in a declarative way.
"""
import argparse
import logging
import os
import sys
import unittest
import yaml
import argparse
import yaml
import tempest.auth
from tempest import config
@ -250,7 +250,7 @@ class JavelinCheck(unittest.TestCase):
break
self.assertNotEqual(count, 59,
"Server %s is not pingable at %s" % (
server['name'], addr))
server['name'], addr))
def check_volumes(self):
"""Check that the volumes are still there and attached."""

View File

@ -18,13 +18,14 @@ import argparse
import inspect
import json
import sys
from testtools import testsuite
try:
from unittest import loader
except ImportError:
# unittest in python 2.6 does not contain loader, so uses unittest2
from unittest2 import loader
from testtools import testsuite
from tempest.openstack.common import log as logging
from tempest.stress import driver

View File

@ -269,7 +269,7 @@ def check_service_availability(os, update):
if getattr(CONF.service_available, codename_match[cfgname]):
print('Endpoint type %s not found either disable service '
'%s or fix the catalog_type in the config file' % (
catalog_type, codename_match[cfgname]))
catalog_type, codename_match[cfgname]))
if update:
change_option(codename_match[cfgname],
'service_available', False)
@ -278,7 +278,7 @@ def check_service_availability(os, update):
codename_match[cfgname]):
print('Endpoint type %s is available, service %s should be'
' set as available in the config file.' % (
catalog_type, codename_match[cfgname]))
catalog_type, codename_match[cfgname]))
if update:
change_option(codename_match[cfgname],
'service_available', True)

View File

@ -14,6 +14,7 @@
import hashlib
import os
import yaml
from tempest import auth

View File

@ -12,6 +12,7 @@
# limitations under the License.
import abc
import six
from tempest import config

View File

@ -14,7 +14,6 @@
from tempest.common import commands
from tempest import config
from tempest.openstack.common import log as logging
CONF = config.CONF

View File

@ -19,15 +19,17 @@ import copy
import hashlib
import httplib
import json
import OpenSSL
import posixpath
import re
from six import moves
import socket
import StringIO
import struct
import urlparse
import OpenSSL
from six import moves
from tempest import exceptions as exc
from tempest.openstack.common import log as logging

View File

@ -16,12 +16,12 @@
import collections
import json
from lxml import etree
import re
import string
import time
import jsonschema
from lxml import etree
from tempest.common import http
from tempest.common.utils import misc as misc_utils

View File

@ -16,11 +16,12 @@
import cStringIO
import select
import six
import socket
import time
import warnings
import six
from tempest import exceptions
from tempest.openstack.common import log as logging

View File

@ -11,9 +11,10 @@
# under the License.
import re
import six
import time
import six
from tempest.common import ssh
from tempest import config
from tempest import exceptions

View File

@ -17,7 +17,6 @@
import logging
import os
import re
import six
import subprocess
import time
@ -27,6 +26,7 @@ from heatclient import exc as heat_exceptions
import netaddr
from neutronclient.common import exceptions as exc
from novaclient import exceptions as nova_exceptions
import six
from tempest.api.network import common as net_common
from tempest import auth

View File

@ -10,9 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import heatclient.exc as heat_exceptions
import time
import heatclient.exc as heat_exceptions
from tempest import config
from tempest.scenario import manager
from tempest import test

View File

@ -15,6 +15,7 @@
# under the License.
import collections
import re
import testtools
from tempest.api.network import common as net_common

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from lxml import etree
import urllib
from lxml import etree
from tempest.common import rest_client
from tempest.common import xml_utils
from tempest import config

View File

@ -15,6 +15,7 @@
import urllib
from lxml import etree
from tempest.common import rest_client
from tempest.common import xml_utils
from tempest import config

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from lxml import etree
import urllib
from lxml import etree
from tempest.common import rest_client
from tempest.common import xml_utils
from tempest import config

View File

@ -10,9 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from lxml import etree
import xml.etree.ElementTree as ET
from lxml import etree
from tempest.common import rest_client
from tempest.common import xml_utils as common
from tempest.services.network import network_client_base as client_base

View File

@ -15,12 +15,12 @@
import json
import urllib
from xml.etree import ElementTree as etree
from tempest.common import http
from tempest.common import rest_client
from tempest import config
from tempest import exceptions
from xml.etree import ElementTree as etree
CONF = config.CONF

View File

@ -15,10 +15,10 @@
import json
import urllib
from xml.etree import ElementTree as etree
from tempest.common import rest_client
from tempest import config
from xml.etree import ElementTree as etree
CONF = config.CONF

View File

@ -14,9 +14,10 @@
# under the License.
import abc
import six
import urllib
import six
from tempest import config
CONF = config.CONF

View File

@ -16,10 +16,9 @@
import urllib
from tempest.openstack.common import jsonutils
from tempest.common import rest_client
from tempest import config
from tempest.openstack.common import jsonutils
CONF = config.CONF

View File

@ -15,6 +15,7 @@
# under the License.
import ast
from lxml import etree
from tempest.common import xml_utils as xml

View File

@ -15,9 +15,9 @@
import time
import urllib
from xml.sax import saxutils
from lxml import etree
from xml.sax import saxutils
from tempest.common import rest_client
from tempest.common import xml_utils as common

View File

@ -13,7 +13,6 @@
# under the License.
import mock
from oslotest import base
from oslotest import moxstubout

View File

@ -13,6 +13,7 @@
# under the License.
import copy
import httplib2

View File

@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import json
import httplib2
import json
TOKEN = "fake_token"

View File

@ -12,9 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
import subprocess
import mock
from tempest.common import commands
from tempest.tests import base

View File

@ -15,9 +15,10 @@
import httplib
import json
import socket
import mock
import six
import socket
from tempest.common import glance_http
from tempest import exceptions

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import httplib2
import json
import httplib2
from oslotest import mockpatch
from tempest.common import rest_client

View File

@ -335,9 +335,11 @@ class TestTenantIsolation(base.TestCase):
remove_router_interface_mock = self.patch(
'tempest.services.network.json.network_client.NetworkClientJSON.'
'remove_router_interface_with_subnet_id')
return_values = ({'status': 200}, {'ports': []})
port_list_mock = mock.patch.object(iso_creds.network_admin_client,
'list_ports', return_value=(
{'status': 200}, {'ports': []}))
'list_ports',
return_value=return_values)
port_list_mock.start()
iso_creds.clear_isolated_creds()
# Verify remove router interface calls

View File

@ -17,7 +17,6 @@ import contextlib
import logging as orig_logging
import os
import re
import six
import urlparse
import boto
@ -25,6 +24,7 @@ from boto import ec2
from boto import exception
from boto import s3
import keystoneclient.exceptions
import six
import tempest.clients
from tempest.common.utils import file_utils

View File

@ -22,6 +22,7 @@ import re
import StringIO
import sys
import urllib2
import yaml

View File

@ -42,10 +42,10 @@
"""Display a subunit stream through a colorized unittest test runner."""
import heapq
import subunit
import sys
import unittest
import subunit
import testtools

View File

@ -16,12 +16,13 @@
# under the License.
import gzip
import pprint
import re
import StringIO
import sys
import urllib2
import pprint
pp = pprint.PrettyPrinter()
NOVA_TIMESTAMP = r"\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d\.\d\d\d"

View File

@ -109,7 +109,8 @@ import_exceptions = tempest.services
[flake8]
# E125 is a won't fix until https://github.com/jcrocholl/pep8/issues/126 is resolved. For further detail see https://review.openstack.org/#/c/36788/
# H402 skipped because some docstrings aren't sentences
# Skipped because of new hacking 0.9: H407,H405,H904,H305,E123,H307,E122,E129,E128
ignore = E125,H402,H404,H407,H405,H904,H305,E123,H307,E122,E129,E128
# E123 skipped because it is ignored by default in the default pep8
# Skipped because of new hacking 0.9: H405,H904,E129,E128
ignore = E125,H402,E123,H404,H405,H904,E129,E128
show-source = True
exclude = .git,.venv,.tox,dist,doc,openstack,*egg