From 7dd1985b901f43e42c6c4fe0a8dd6cd74e2e8533 Mon Sep 17 00:00:00 2001 From: Kazuhiro MIYAHARA Date: Mon, 13 Mar 2017 16:57:50 +0900 Subject: [PATCH] Update calling super class constructor style in proxy controllers "swift.proxy.controllers.base.Controller" inherits "object", so the Controller class and its sub classes (AccountController, ContainerController, BaseObjectController, InfoController) are "new style class". In new style class, if a class call super class's constructor, "super(SubClass, self).__init__(foo, bar)" is recommended. But, AccountController, ContainerController, BaseObjectController, and InfoController use "Controller.__init__(self, app)", and it is deprecated. This patch fixes the calling super class constructor codes. Change-Id: I4b94ec3131c7c7be4609716867a36490a70d5009 Closes-Bug: #1672285 --- swift/proxy/controllers/account.py | 2 +- swift/proxy/controllers/container.py | 2 +- swift/proxy/controllers/info.py | 2 +- swift/proxy/controllers/obj.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/swift/proxy/controllers/account.py b/swift/proxy/controllers/account.py index 2abb3d1f79..6fc94a9891 100644 --- a/swift/proxy/controllers/account.py +++ b/swift/proxy/controllers/account.py @@ -35,7 +35,7 @@ class AccountController(Controller): server_type = 'Account' def __init__(self, app, account_name, **kwargs): - Controller.__init__(self, app) + super(AccountController, self).__init__(app) self.account_name = unquote(account_name) if not self.app.allow_account_management: self.allowed_methods.remove('PUT') diff --git a/swift/proxy/controllers/container.py b/swift/proxy/controllers/container.py index 6f5feaa70c..33791abf60 100644 --- a/swift/proxy/controllers/container.py +++ b/swift/proxy/controllers/container.py @@ -38,7 +38,7 @@ class ContainerController(Controller): 'x-versions-location'] def __init__(self, app, account_name, container_name, **kwargs): - Controller.__init__(self, app) + super(ContainerController, self).__init__(app) self.account_name = unquote(account_name) self.container_name = unquote(container_name) diff --git a/swift/proxy/controllers/info.py b/swift/proxy/controllers/info.py index 57f3c1b90f..89c5a8b3bf 100644 --- a/swift/proxy/controllers/info.py +++ b/swift/proxy/controllers/info.py @@ -28,7 +28,7 @@ class InfoController(Controller): def __init__(self, app, version, expose_info, disallowed_sections, admin_key): - Controller.__init__(self, app) + super(InfoController, self).__init__(app) self.expose_info = expose_info self.disallowed_sections = disallowed_sections self.admin_key = admin_key diff --git a/swift/proxy/controllers/obj.py b/swift/proxy/controllers/obj.py index 3895cb356a..1af00490b4 100644 --- a/swift/proxy/controllers/obj.py +++ b/swift/proxy/controllers/obj.py @@ -124,7 +124,7 @@ class BaseObjectController(Controller): def __init__(self, app, account_name, container_name, object_name, **kwargs): - Controller.__init__(self, app) + super(BaseObjectController, self).__init__(app) self.account_name = unquote(account_name) self.container_name = unquote(container_name) self.object_name = unquote(object_name)