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
This commit is contained in:
ljhuang 2022-08-03 20:35:27 +08:00
parent cdf45da555
commit c9c8a0e717
1 changed files with 18 additions and 9 deletions

View File

@ -105,7 +105,8 @@ class DataDriverBase(DriverBase, metaclass=abc.ABCMeta):
"""Check whether the storage is ready.""" """Check whether the storage is ready."""
raise NotImplementedError raise NotImplementedError
@abc.abstractproperty @property
@abc.abstractmethod
def capabilities(self): def capabilities(self):
"""Returns storage's capabilities.""" """Returns storage's capabilities."""
return self.BASE_CAPABILITIES return self.BASE_CAPABILITIES
@ -226,17 +227,20 @@ class DataDriverBase(DriverBase, metaclass=abc.ABCMeta):
def queue_controller(self): def queue_controller(self):
return self.control_driver.queue_controller return self.control_driver.queue_controller
@abc.abstractproperty @property
@abc.abstractmethod
def message_controller(self): def message_controller(self):
"""Returns the driver's message controller.""" """Returns the driver's message controller."""
raise NotImplementedError raise NotImplementedError
@abc.abstractproperty @property
@abc.abstractmethod
def claim_controller(self): def claim_controller(self):
"""Returns the driver's claim controller.""" """Returns the driver's claim controller."""
raise NotImplementedError raise NotImplementedError
@abc.abstractproperty @property
@abc.abstractmethod
def subscription_controller(self): def subscription_controller(self):
"""Returns the driver's subscription controller.""" """Returns the driver's subscription controller."""
raise NotImplementedError raise NotImplementedError
@ -264,27 +268,32 @@ class ControlDriverBase(DriverBase, metaclass=abc.ABCMeta):
:type cache: `dogpile.cache.region.CacheRegion` :type cache: `dogpile.cache.region.CacheRegion`
""" """
@abc.abstractproperty @property
@abc.abstractmethod
def catalogue_controller(self): def catalogue_controller(self):
"""Returns the driver's catalogue controller.""" """Returns the driver's catalogue controller."""
raise NotImplementedError raise NotImplementedError
@abc.abstractproperty @property
@abc.abstractmethod
def pools_controller(self): def pools_controller(self):
"""Returns storage's pool management controller.""" """Returns storage's pool management controller."""
raise NotImplementedError raise NotImplementedError
@abc.abstractproperty @property
@abc.abstractmethod
def flavors_controller(self): def flavors_controller(self):
"""Returns storage's flavor management controller.""" """Returns storage's flavor management controller."""
raise NotImplementedError raise NotImplementedError
@abc.abstractproperty @property
@abc.abstractmethod
def queue_controller(self): def queue_controller(self):
"""Returns the driver's queue controller.""" """Returns the driver's queue controller."""
raise NotImplementedError raise NotImplementedError
@abc.abstractproperty @property
@abc.abstractmethod
def topic_controller(self): def topic_controller(self):
"""Returns the driver's topic controller.""" """Returns the driver's topic controller."""
raise NotImplementedError raise NotImplementedError