From c9c8a0e71713a52366e139eb6bce5c4ffbbc5195 Mon Sep 17 00:00:00 2001 From: ljhuang Date: Wed, 3 Aug 2022 20:35:27 +0800 Subject: [PATCH] Replace abc.abstractproperty with property and abc.abstractmethod Replace abc.abstractproperty with property and abc.abstractmethod, as abc.abstractproperty has been deprecated since python3.3[1] [1]https://docs.python.org/3.8/whatsnew/3.3.html?highlight=deprecated#abc Change-Id: If6204796a34031551817191d0ea602011f60de9a --- zaqar/storage/base.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/zaqar/storage/base.py b/zaqar/storage/base.py index c1dfebffd..6d0d87b43 100644 --- a/zaqar/storage/base.py +++ b/zaqar/storage/base.py @@ -105,7 +105,8 @@ class DataDriverBase(DriverBase, metaclass=abc.ABCMeta): """Check whether the storage is ready.""" raise NotImplementedError - @abc.abstractproperty + @property + @abc.abstractmethod def capabilities(self): """Returns storage's capabilities.""" return self.BASE_CAPABILITIES @@ -226,17 +227,20 @@ class DataDriverBase(DriverBase, metaclass=abc.ABCMeta): def queue_controller(self): return self.control_driver.queue_controller - @abc.abstractproperty + @property + @abc.abstractmethod def message_controller(self): """Returns the driver's message controller.""" raise NotImplementedError - @abc.abstractproperty + @property + @abc.abstractmethod def claim_controller(self): """Returns the driver's claim controller.""" raise NotImplementedError - @abc.abstractproperty + @property + @abc.abstractmethod def subscription_controller(self): """Returns the driver's subscription controller.""" raise NotImplementedError @@ -264,27 +268,32 @@ class ControlDriverBase(DriverBase, metaclass=abc.ABCMeta): :type cache: `dogpile.cache.region.CacheRegion` """ - @abc.abstractproperty + @property + @abc.abstractmethod def catalogue_controller(self): """Returns the driver's catalogue controller.""" raise NotImplementedError - @abc.abstractproperty + @property + @abc.abstractmethod def pools_controller(self): """Returns storage's pool management controller.""" raise NotImplementedError - @abc.abstractproperty + @property + @abc.abstractmethod def flavors_controller(self): """Returns storage's flavor management controller.""" raise NotImplementedError - @abc.abstractproperty + @property + @abc.abstractmethod def queue_controller(self): """Returns the driver's queue controller.""" raise NotImplementedError - @abc.abstractproperty + @property + @abc.abstractmethod def topic_controller(self): """Returns the driver's topic controller.""" raise NotImplementedError