Cleanup code and remove newly ignored hack rules

newer hacking has rules for the following:
  H105  Don't use author tags
  H238  old style class declaration, use new style (inherit from `object`)
  W292 no newline at end of file

So we need to clean them up and stop ignoring them

Change-Id: I12b995cf87d6bc0938298f397b41a4693627bb4b
This commit is contained in:
Davanum Srinivas 2015-02-06 22:39:25 -05:00
parent e9dba9d4cd
commit d43259dbf2
22 changed files with 20 additions and 29 deletions

View File

@ -2,8 +2,6 @@
# #
# Copyright © 2012 New Dream Network, LLC (DreamHost) # Copyright © 2012 New Dream Network, LLC (DreamHost)
# #
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain # not use this file except in compliance with the License. You may obtain
# a copy of the License at # a copy of the License at

View File

@ -2,8 +2,6 @@
# #
# Copyright © 2012 New Dream Network, LLC (DreamHost) # Copyright © 2012 New Dream Network, LLC (DreamHost)
# #
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain # not use this file except in compliance with the License. You may obtain
# a copy of the License at # a copy of the License at

View File

@ -2,8 +2,6 @@
# #
# Copyright © 2012 New Dream Network, LLC (DreamHost) # Copyright © 2012 New Dream Network, LLC (DreamHost)
# #
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain # not use this file except in compliance with the License. You may obtain
# a copy of the License at # a copy of the License at
@ -117,4 +115,4 @@ class NoExceptionTracebackHook(hooks.PecanHook):
json_body['faultstring'] = faultsting.rstrip() json_body['faultstring'] = faultsting.rstrip()
# Replace the whole json. Cannot change original one beacause it's # Replace the whole json. Cannot change original one beacause it's
# generated on the fly. # generated on the fly.
state.response.json = json_body state.response.json = json_body

View File

@ -2,8 +2,6 @@
# #
# Copyright ? 2012 New Dream Network, LLC (DreamHost) # Copyright ? 2012 New Dream Network, LLC (DreamHost)
# #
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain # not use this file except in compliance with the License. You may obtain
# a copy of the License at # a copy of the License at
@ -88,4 +86,4 @@ class ParsableErrorMiddleware(object):
state['headers'].append(('Content-Length', len(body[0]))) state['headers'].append(('Content-Length', len(body[0])))
else: else:
body = app_iter body = app_iter
return body return body

View File

@ -110,4 +110,4 @@ class Container(ContainerBase):
@abc.abstractmethod @abc.abstractmethod
def execute(self, cmd): def execute(self, cmd):
pass pass

View File

@ -65,4 +65,4 @@ def parse(manifest_str):
raise ValueError(_('The manifest is not a JSON object ' raise ValueError(_('The manifest is not a JSON object '
'or YAML mapping.')) 'or YAML mapping.'))
# TODO(yuanying): check manifest version # TODO(yuanying): check manifest version
return manifest return manifest

View File

@ -76,4 +76,4 @@ class DockerHTTPClient(client.Client):
self.load_image(fh) self.load_image(fh)
def get_container_logs(self, docker_id): def get_container_logs(self, docker_id):
return self.attach(docker_id, 1, 1, 0, 1) return self.attach(docker_id, 1, 1, 0, 1)

View File

@ -32,7 +32,7 @@ from magnum.openstack.common import versionutils
LOG = logging.getLogger('object') LOG = logging.getLogger('object')
class NotSpecifiedSentinel: class NotSpecifiedSentinel(object):
pass pass

View File

@ -265,4 +265,4 @@ class TestDelete(api_base.FunctionalTest):
response = self.delete('/nodes/%s' % uuid, expect_errors=True) response = self.delete('/nodes/%s' % uuid, expect_errors=True)
self.assertEqual(404, response.status_int) self.assertEqual(404, response.status_int)
self.assertEqual('application/json', response.content_type) self.assertEqual('application/json', response.content_type)
self.assertTrue(response.json['error_message']) self.assertTrue(response.json['error_message'])

View File

@ -381,4 +381,4 @@ class TestDelete(api_base.FunctionalTest):
response = self.delete('/pods/%s' % uuid, expect_errors=True) response = self.delete('/pods/%s' % uuid, expect_errors=True)
self.assertEqual(404, response.status_int) self.assertEqual(404, response.status_int)
self.assertEqual('application/json', response.content_type) self.assertEqual('application/json', response.content_type)
self.assertTrue(response.json['error_message']) self.assertTrue(response.json['error_message'])

View File

@ -311,4 +311,4 @@ class TestDelete(api_base.FunctionalTest):
response = self.delete('/services/%s' % uuid, expect_errors=True) response = self.delete('/services/%s' % uuid, expect_errors=True)
self.assertEqual(404, response.status_int) self.assertEqual(404, response.status_int)
self.assertEqual('application/json', response.content_type) self.assertEqual('application/json', response.content_type)
self.assertTrue(response.json['error_message']) self.assertTrue(response.json['error_message'])

View File

@ -136,4 +136,4 @@ class TestNoExceptionTracebackHook(api_base.FunctionalTest):
actual_msg = json.loads( actual_msg = json.loads(
response.json['error_message'])['faultstring'] response.json['error_message'])['faultstring']
self.assertEqual(self.MSG_WITH_TRACE, actual_msg) self.assertEqual(self.MSG_WITH_TRACE, actual_msg)

View File

@ -91,4 +91,4 @@ def rc_post_data(**kw):
def node_post_data(**kw): def node_post_data(**kw):
node = utils.get_test_node(**kw) node = utils.get_test_node(**kw)
internal = node_controller.NodePatchType.internal_attrs() internal = node_controller.NodePatchType.internal_attrs()
return remove_internal(node, internal) return remove_internal(node, internal)

View File

@ -193,4 +193,4 @@ class TestException(base.BaseTestCase):
def test_NodeAssociated(self): def test_NodeAssociated(self):
self.assertRaises(exception.NodeAssociated, self.assertRaises(exception.NodeAssociated,
lambda: self.raise_(exception.NodeAssociated())) lambda: self.raise_(exception.NodeAssociated()))

View File

@ -56,4 +56,4 @@ class K8sManifestTestCase(base.TestCase):
def test_parse_invalid_value(self): def test_parse_invalid_value(self):
invalid_str = 'aoa89**' invalid_str = 'aoa89**'
self.assertRaises(ValueError, k8s_manifest.parse, invalid_str) self.assertRaises(ValueError, k8s_manifest.parse, invalid_str)

View File

@ -96,4 +96,4 @@ class GetCallArgsTestCase(base.BaseTestCase):
self.assertIn('red', callargs) self.assertIn('red', callargs)
self.assertEqual(3, callargs['red']) self.assertEqual(3, callargs['red'])
self.assertIn('blue', callargs) self.assertIn('blue', callargs)
self.assertIsNone(callargs['blue']) self.assertIsNone(callargs['blue'])

View File

@ -52,4 +52,4 @@ class TestUrlFetch(base.BaseTestCase):
self.assertRaises(urlfetch.URLFetchError, self.assertRaises(urlfetch.URLFetchError,
urlfetch.get, urlfetch.get,
'http://example.com') 'http://example.com')

View File

@ -498,4 +498,4 @@ class TempFilesTestCase(base.TestCase):
tempdir_created = tempdir tempdir_created = tempdir
rmtree_mock.assert_called_once_with(tempdir_created) rmtree_mock.assert_called_once_with(tempdir_created)
self.assertTrue(log_mock.error.called) self.assertTrue(log_mock.error.called)

View File

@ -141,4 +141,4 @@ class TestKubeUtils(base.BaseTestCase):
mock_file.write.assert_called_once_with(expected_data) mock_file.write.assert_called_once_with(expected_data)
mock_k8s_update.assert_called_once_with(expected_master_address, mock_k8s_update.assert_called_once_with(expected_master_address,
expected_filename) expected_filename)

View File

@ -54,7 +54,7 @@ class FakePecanResponse(mock.Mock):
self.status = None self.status = None
class FakeApp: class FakeApp(object):
pass pass

View File

@ -177,4 +177,4 @@ def create_test_node(ctxt, **kw):
""" """
node = get_test_node(ctxt, **kw) node = get_test_node(ctxt, **kw)
node.create() node.create()
return node return node

View File

@ -40,7 +40,6 @@ commands =
# The rest of the ignores are TODOs # The rest of the ignores are TODOs
# New from hacking 0.9: E129, E131, H407, H405, H904 # New from hacking 0.9: E129, E131, H407, H405, H904
# E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301 # E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
# TODO(dims): Fix temporarily ignored H105, H238, W292
ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H302,H105,H238,H405,H803,H904,E711,W292 ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H302,H405,H803,H904,E711
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools