Replace deprecated abc.abstractproperty

It was deprecated in Python 3.3 [1].

[1] https://docs.python.org/3.13/whatsnew/3.3.html#abc

Change-Id: Ibd98cb93f697a6da6a6bc5a5030640a262c7a66b
This commit is contained in:
Takashi Kajinami
2025-03-02 12:57:24 +09:00
parent 77a30ef281
commit df3d67a4ed
6 changed files with 24 additions and 12 deletions

View File

@@ -118,7 +118,8 @@ class BaseAction(loadable.Loadable, metaclass=abc.ABCMeta):
""" """
raise NotImplementedError() raise NotImplementedError()
@abc.abstractproperty @property
@abc.abstractmethod
def schema(self): def schema(self):
"""Defines a Schema that the input parameters shall comply to """Defines a Schema that the input parameters shall comply to

View File

@@ -19,30 +19,37 @@ import abc
class ServiceManager(object, metaclass=abc.ABCMeta): class ServiceManager(object, metaclass=abc.ABCMeta):
@abc.abstractproperty @property
@abc.abstractmethod
def service_name(self): def service_name(self):
raise NotImplementedError() raise NotImplementedError()
@abc.abstractproperty @property
@abc.abstractmethod
def api_version(self): def api_version(self):
raise NotImplementedError() raise NotImplementedError()
@abc.abstractproperty @property
@abc.abstractmethod
def publisher_id(self): def publisher_id(self):
raise NotImplementedError() raise NotImplementedError()
@abc.abstractproperty @property
@abc.abstractmethod
def conductor_topic(self): def conductor_topic(self):
raise NotImplementedError() raise NotImplementedError()
@abc.abstractproperty @property
@abc.abstractmethod
def notification_topics(self): def notification_topics(self):
raise NotImplementedError() raise NotImplementedError()
@abc.abstractproperty @property
@abc.abstractmethod
def conductor_endpoints(self): def conductor_endpoints(self):
raise NotImplementedError() raise NotImplementedError()
@abc.abstractproperty @property
@abc.abstractmethod
def notification_endpoints(self): def notification_endpoints(self):
raise NotImplementedError() raise NotImplementedError()

View File

@@ -36,7 +36,8 @@ class IndicatorSpecification(object, metaclass=abc.ABCMeta):
self.unit = unit self.unit = unit
self.required = required self.required = required
@abc.abstractproperty @property
@abc.abstractmethod
def schema(self): def schema(self):
"""JsonSchema used to validate the indicator value """JsonSchema used to validate the indicator value

View File

@@ -147,7 +147,8 @@ class BaseClusterDataModelCollector(loadable.LoadableSingleton,
self._cluster_data_model = model self._cluster_data_model = model
self.lock.release() self.lock.release()
@abc.abstractproperty @property
@abc.abstractmethod
def notification_endpoints(self): def notification_endpoints(self):
"""Associated notification endpoints """Associated notification endpoints

View File

@@ -26,7 +26,8 @@ class NotificationEndpoint(object, metaclass=abc.ABCMeta):
self.collector = collector self.collector = collector
self._notifier = None self._notifier = None
@abc.abstractproperty @property
@abc.abstractmethod
def filter_rule(self): def filter_rule(self):
"""Notification Filter""" """Notification Filter"""
raise NotImplementedError() raise NotImplementedError()

View File

@@ -114,6 +114,7 @@ class BaseSolution(object, metaclass=abc.ABCMeta):
""" """
raise NotImplementedError() raise NotImplementedError()
@abc.abstractproperty @property
@abc.abstractmethod
def actions(self): def actions(self):
raise NotImplementedError() raise NotImplementedError()