From 0562e3335bd5ee5b51a56cfe002c1895b52ef52a Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 21 Dec 2021 11:37:31 +0000 Subject: [PATCH] Remove six.add_metaclass usage Change-Id: If0d2ad8357ea759638c6b83c04ec7a2f3cf9f6bd Signed-off-by: Stephen Finucane --- glance/common/wsgi.py | 3 +-- glance/notifier.py | 9 +++------ glance/tests/functional/__init__.py | 4 +--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/glance/common/wsgi.py b/glance/common/wsgi.py index 8a6267f790..9379369240 100644 --- a/glance/common/wsgi.py +++ b/glance/common/wsgi.py @@ -429,8 +429,7 @@ def get_asynchronous_eventlet_pool(size=1000): return pool -@six.add_metaclass(abc.ABCMeta) -class BaseServer(object): +class BaseServer(metaclass=abc.ABCMeta): """Server class to manage multiple WSGI sockets and applications. This class requires initialize_glance_store set to True if diff --git a/glance/notifier.py b/glance/notifier.py index 5bc8955020..b55d59980a 100644 --- a/glance/notifier.py +++ b/glance/notifier.py @@ -330,8 +330,7 @@ class NotificationBase(object): _send_notification(self.notifier.info, notification_id, payload) -@six.add_metaclass(abc.ABCMeta) -class NotificationProxy(NotificationBase): +class NotificationProxy(NotificationBase, metaclass=abc.ABCMeta): def __init__(self, repo, context, notifier): self.repo = repo self.context = context @@ -345,8 +344,7 @@ class NotificationProxy(NotificationBase): pass -@six.add_metaclass(abc.ABCMeta) -class NotificationRepoProxy(NotificationBase): +class NotificationRepoProxy(NotificationBase, metaclass=abc.ABCMeta): def __init__(self, repo, context, notifier): self.repo = repo self.context = context @@ -366,8 +364,7 @@ class NotificationRepoProxy(NotificationBase): pass -@six.add_metaclass(abc.ABCMeta) -class NotificationFactoryProxy(object): +class NotificationFactoryProxy(metaclass=abc.ABCMeta): def __init__(self, factory, context, notifier): kwargs = {'context': context, 'notifier': notifier} diff --git a/glance/tests/functional/__init__.py b/glance/tests/functional/__init__.py index c65455862e..542b922d2f 100644 --- a/glance/tests/functional/__init__.py +++ b/glance/tests/functional/__init__.py @@ -29,7 +29,6 @@ import os import platform import shutil import signal -import six import socket import subprocess import sys @@ -78,8 +77,7 @@ except RuntimeError: pass -@six.add_metaclass(abc.ABCMeta) -class BaseServer(object): +class BaseServer(metaclass=abc.ABCMeta): """ Class used to easily manage starting and stopping a server during functional test runs.