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
This commit is contained in:
parent
8b2f01a619
commit
7dd1985b90
@ -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')
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user