summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Pittau <elfosardo@gmail.com>2020-08-05 18:28:13 +0200
committerRiccardo Pittau <elfosardo@gmail.com>2020-08-06 11:34:23 +0200
commit00a23de3aef65947a3a308baa592e40b95259352 (patch)
tree55045471b94db42a50e13a82f009c9db3b58bfdb
parent325aea27ead92e49e40bc34d434c591b663e5d6e (diff)
downloadironic-00a23de3aef65947a3a308baa592e40b95259352.tar.gz
Use property plus abstractmethod for abstractproperty
The abstractproperty method is deprecated since Python 3.3 [1] [1] https://docs.python.org/3/library/abc.html#abc.abstractproperty Change-Id: Iee18e476c0125b80583567f71ccd6c6be29aa36a
-rw-r--r--ironic/drivers/hardware_type.py12
-rw-r--r--ironic/drivers/modules/snmp.py9
2 files changed, 14 insertions, 7 deletions
diff --git a/ironic/drivers/hardware_type.py b/ironic/drivers/hardware_type.py
index 0ec71210e..df5f43782 100644
--- a/ironic/drivers/hardware_type.py
+++ b/ironic/drivers/hardware_type.py
@@ -42,19 +42,23 @@ class AbstractHardwareType(object, metaclass=abc.ABCMeta):
# Required hardware interfaces
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def supported_boot_interfaces(self):
"""List of supported boot interfaces."""
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def supported_deploy_interfaces(self):
"""List of supported deploy interfaces."""
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def supported_management_interfaces(self):
"""List of supported management interfaces."""
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def supported_power_interfaces(self):
"""List of supported power interfaces."""
diff --git a/ironic/drivers/modules/snmp.py b/ironic/drivers/modules/snmp.py
index 008886b90..ab6c3ade4 100644
--- a/ironic/drivers/modules/snmp.py
+++ b/ironic/drivers/modules/snmp.py
@@ -554,15 +554,18 @@ class SNMPDriverSimple(SNMPDriverBase):
super(SNMPDriverSimple, self).__init__(*args, **kwargs)
self.oid = self._snmp_oid()
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def oid_device(self):
"""Device dependent portion of the power state object OID."""
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def value_power_on(self):
"""Value representing power on state."""
- @abc.abstractproperty
+ @property
+ @abc.abstractmethod
def value_power_off(self):
"""Value representing power off state."""