From 2720765cb3aa61a7b271dbeeadefaa62fa8e120f Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Tue, 19 May 2015 09:25:57 +0200 Subject: [PATCH] Prepare for hacking 0.10.x Fix new warning that are introduced with hacking 0.10.x. The failure messages fixed are: H238 old style class declaration, use new style (inherit from `object`) H105 Don't use author tags H501 Do not use self.__dict__ for string formatting Change-Id: Ia070d60754dfd85966178eadbf82a4d98b64407a --- ironic/api/acl.py | 2 -- ironic/api/controllers/root.py | 2 -- ironic/api/hooks.py | 2 -- ironic/api/middleware/parsable_error.py | 2 -- ironic/common/service.py | 2 -- ironic/objects/base.py | 2 +- ironic/tests/drivers/test_seamicro.py | 6 +++--- ironic/tests/matchers.py | 6 ++++-- ironic/tests/test_driver_factory.py | 2 +- ironic/tests/test_keystone.py | 4 ++-- 10 files changed, 11 insertions(+), 19 deletions(-) diff --git a/ironic/api/acl.py b/ironic/api/acl.py index a22a64910b..5d839a221d 100644 --- a/ironic/api/acl.py +++ b/ironic/api/acl.py @@ -2,8 +2,6 @@ # # Copyright © 2012 New Dream Network, LLC (DreamHost) # -# Author: Doug Hellmann -# # 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 # a copy of the License at diff --git a/ironic/api/controllers/root.py b/ironic/api/controllers/root.py index c3ba09775f..70fb594ca7 100644 --- a/ironic/api/controllers/root.py +++ b/ironic/api/controllers/root.py @@ -2,8 +2,6 @@ # # Copyright © 2012 New Dream Network, LLC (DreamHost) # -# Author: Doug Hellmann -# # 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 # a copy of the License at diff --git a/ironic/api/hooks.py b/ironic/api/hooks.py index 2c30b7275d..ddf81a9860 100644 --- a/ironic/api/hooks.py +++ b/ironic/api/hooks.py @@ -2,8 +2,6 @@ # # Copyright © 2012 New Dream Network, LLC (DreamHost) # -# Author: Doug Hellmann -# # 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 # a copy of the License at diff --git a/ironic/api/middleware/parsable_error.py b/ironic/api/middleware/parsable_error.py index 02ca51ef0a..742ee534fc 100644 --- a/ironic/api/middleware/parsable_error.py +++ b/ironic/api/middleware/parsable_error.py @@ -2,8 +2,6 @@ # # Copyright © 2012 New Dream Network, LLC (DreamHost) # -# Author: Doug Hellmann -# # 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 # a copy of the License at diff --git a/ironic/common/service.py b/ironic/common/service.py index d4243df067..b3d3a64b72 100644 --- a/ironic/common/service.py +++ b/ironic/common/service.py @@ -2,8 +2,6 @@ # # Copyright © 2012 eNovance # -# Author: Julien Danjou -# # 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 # a copy of the License at diff --git a/ironic/objects/base.py b/ironic/objects/base.py index 8ff6a3c7f9..cfb3c7a4fe 100644 --- a/ironic/objects/base.py +++ b/ironic/objects/base.py @@ -32,7 +32,7 @@ from ironic.openstack.common import versionutils LOG = logging.getLogger('object') -class NotSpecifiedSentinel: +class NotSpecifiedSentinel(object): pass diff --git a/ironic/tests/drivers/test_seamicro.py b/ironic/tests/drivers/test_seamicro.py index e39737ef1a..3271e5dae3 100644 --- a/ironic/tests/drivers/test_seamicro.py +++ b/ironic/tests/drivers/test_seamicro.py @@ -34,7 +34,7 @@ from ironic.tests.objects import utils as obj_utils INFO_DICT = db_utils.get_test_seamicro_info() -class Fake_Server(): +class Fake_Server(object): def __init__(self, active=False, *args, **kwargs): self.active = active self.nic = {'0': {'untaggedVlan': ''}} @@ -64,7 +64,7 @@ class Fake_Server(): return self -class Fake_Volume(): +class Fake_Volume(object): def __init__(self, id=None, *args, **kwargs): if id is None: self.id = "%s/%s/%s" % ("0", "ironic-p6-6", str(uuid.uuid4())) @@ -72,7 +72,7 @@ class Fake_Volume(): self.id = id -class Fake_Pool(): +class Fake_Pool(object): def __init__(self, freeSize=None, *args, **kwargs): self.freeSize = freeSize diff --git a/ironic/tests/matchers.py b/ironic/tests/matchers.py index 1c8207a767..6c88f19948 100644 --- a/ironic/tests/matchers.py +++ b/ironic/tests/matchers.py @@ -26,7 +26,8 @@ class DictKeysMismatch(object): def describe(self): return ('Keys in d1 and not d2: %(d1only)s.' - ' Keys in d2 and not d1: %(d2only)s' % self.__dict__) + ' Keys in d2 and not d1: %(d2only)s' % + {'d1only': self.d1only, 'd2only': self.d2only}) def get_details(self): return {} @@ -40,7 +41,8 @@ class DictMismatch(object): def describe(self): return ("Dictionaries do not match at %(key)s." - " d1: %(d1_value)s d2: %(d2_value)s" % self.__dict__) + " d1: %(d1_value)s d2: %(d2_value)s" % + {'d1_value': self.d1_value, 'd2_value': self.d2_value}) def get_details(self): return {} diff --git a/ironic/tests/test_driver_factory.py b/ironic/tests/test_driver_factory.py index 1dee9d0de5..8698cc6319 100644 --- a/ironic/tests/test_driver_factory.py +++ b/ironic/tests/test_driver_factory.py @@ -20,7 +20,7 @@ from ironic.common import exception from ironic.tests import base -class FakeEp: +class FakeEp(object): name = 'fake' diff --git a/ironic/tests/test_keystone.py b/ironic/tests/test_keystone.py index 7933ffe7ef..dddcc0b0ee 100644 --- a/ironic/tests/test_keystone.py +++ b/ironic/tests/test_keystone.py @@ -20,12 +20,12 @@ from ironic.common import keystone from ironic.tests import base -class FakeCatalog: +class FakeCatalog(object): def url_for(self, **kwargs): return 'fake-url' -class FakeClient: +class FakeClient(object): def __init__(self, **kwargs): self.service_catalog = FakeCatalog()