Explorar o código

Replace all deprecated `@abc.abstractclassmethod` declarations

Replaced them with stacked `@classmethod\n@abc.abstractmethod`
Daniel Vincze hai 1 semana
pai
achega
4c58560613

+ 4 - 2
coriolis/osmorphing/base.py

@@ -50,7 +50,8 @@ class BaseOSMorphingTools(object, with_metaclass(abc.ABCMeta)):
         self._osmorphing_parameters = osmorphing_parameters
         self._osmorphing_operation_timeout = operation_timeout
 
-    @abc.abstractclassmethod
+    @classmethod
+    @abc.abstractmethod
     def get_required_detected_os_info_fields(cls):
         raise NotImplementedError("Required OS params not defined.")
 
@@ -76,7 +77,8 @@ class BaseOSMorphingTools(object, with_metaclass(abc.ABCMeta)):
                     extra_os_info_fields, cls.__name__, detected_os_info))
         return True
 
-    @abc.abstractclassmethod
+    @classmethod
+    @abc.abstractmethod
     def check_os_supported(cls, detected_os_info):
         raise NotImplementedError(
             "OS compatibility check not implemented for tools class %s" % (

+ 2 - 1
coriolis/osmorphing/osdetect/base.py

@@ -25,7 +25,8 @@ class BaseOSDetectTools(object, with_metaclass(abc.ABCMeta)):
         self._environment = {}
         self._osdetect_operation_timeout = operation_timeout
 
-    @abc.abstractclassmethod
+    @classmethod
+    @abc.abstractmethod
     def returned_detected_os_info_fields(cls):
         raise NotImplementedError(
             "No returned OS info fields by class '%s'" % cls.__name__)

+ 8 - 4
coriolis/tasks/base.py

@@ -48,7 +48,8 @@ class TaskRunner(with_metaclass(abc.ABCMeta)):
 
         return required_libs
 
-    @abc.abstractclassmethod
+    @classmethod
+    @abc.abstractmethod
     def get_required_task_info_properties(cls):
         """ Returns a list of the string fields which are required
         to be present during the tasks' run method. """
@@ -56,7 +57,8 @@ class TaskRunner(with_metaclass(abc.ABCMeta)):
             "No required task info properties specified for task class of "
             "type '%s'." % cls)
 
-    @abc.abstractclassmethod
+    @classmethod
+    @abc.abstractmethod
     def get_returned_task_info_properties(cls):
         """ Returns a list of the string fields which are returned by the
         tasks' run method to be added to the task info.
@@ -65,7 +67,8 @@ class TaskRunner(with_metaclass(abc.ABCMeta)):
             "No returned task info properties specified for task class of "
             "type '%s'." % cls)
 
-    @abc.abstractclassmethod
+    @classmethod
+    @abc.abstractmethod
     def get_required_provider_types(cls):
         """ Returns a dict with 'source/destination' as keys containing a list
         of all the provider types (constants.PROVIDER_TYPE_*) required for the
@@ -75,7 +78,8 @@ class TaskRunner(with_metaclass(abc.ABCMeta)):
             "No required provider types specified for task class of "
             "type '%s'." % cls)
 
-    @abc.abstractclassmethod
+    @classmethod
+    @abc.abstractmethod
     def get_required_platform(cls):
         """ Returns whether the task operates on the source platform, the
         destination, or both. (constants.TASK_PLATFORM_*)