From bb6b19c9dc55c6d4af196e556fda136ffc0e5507 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Thu, 22 Jan 2015 11:22:21 -0800 Subject: [PATCH] Remove usage of taskflow 'utils.misc' module The failure type at its old location in an internal utils directory of taskflow is deprecated (in general usage of taskflow utils code should be restricted/not done) and it has been moved to a public location of taskflow.types (which is ok to use and is not deprecated). This change updates to use the better and more supported module/code location instead. Change-Id: I8b8c6e98c934fbf1341b8f1c907ecd385405a3c1 --- cinder/volume/flows/api/create_volume.py | 10 +++++----- cinder/volume/flows/manager/create_volume.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cinder/volume/flows/api/create_volume.py b/cinder/volume/flows/api/create_volume.py index 6a72a3006..3d763d52e 100644 --- a/cinder/volume/flows/api/create_volume.py +++ b/cinder/volume/flows/api/create_volume.py @@ -16,7 +16,7 @@ from oslo.utils import units from oslo_config import cfg import taskflow.engines from taskflow.patterns import linear_flow -from taskflow.utils import misc +from taskflow.types import failure as ft from cinder import exception from cinder import flow_utils @@ -510,7 +510,7 @@ class EntryCreateTask(flow_utils.CinderTask): def revert(self, context, result, optional_args, **kwargs): # We never produced a result and therefore can't destroy anything. - if isinstance(result, misc.Failure): + if isinstance(result, ft.Failure): return if optional_args['is_quota_committed']: @@ -595,7 +595,7 @@ class QuotaReserveTask(flow_utils.CinderTask): def revert(self, context, result, optional_args, **kwargs): # We never produced a result and therefore can't destroy anything. - if isinstance(result, misc.Failure): + if isinstance(result, ft.Failure): return if optional_args['is_quota_committed']: @@ -641,7 +641,7 @@ class QuotaCommitTask(flow_utils.CinderTask): def revert(self, context, result, **kwargs): # We never produced a result and therefore can't destroy anything. - if isinstance(result, misc.Failure): + if isinstance(result, ft.Failure): return volume = result['volume_properties'] try: @@ -749,7 +749,7 @@ class VolumeCastTask(flow_utils.CinderTask): self._cast_create_volume(context, request_spec, filter_properties) def revert(self, context, result, flow_failures, **kwargs): - if isinstance(result, misc.Failure): + if isinstance(result, ft.Failure): return # Restore the source volume status and set the volume to error status. diff --git a/cinder/volume/flows/manager/create_volume.py b/cinder/volume/flows/manager/create_volume.py index 894dad02a..5ccb109b1 100644 --- a/cinder/volume/flows/manager/create_volume.py +++ b/cinder/volume/flows/manager/create_volume.py @@ -17,7 +17,7 @@ from oslo_concurrency import processutils from oslo_config import cfg import taskflow.engines from taskflow.patterns import linear_flow -from taskflow.utils import misc +from taskflow.types import failure as ft from cinder import exception from cinder import flow_utils @@ -184,7 +184,7 @@ class ExtractVolumeRefTask(flow_utils.CinderTask): return volume_ref def revert(self, context, volume_id, result, **kwargs): - if isinstance(result, misc.Failure): + if isinstance(result, ft.Failure): return common.error_out_volume(context, self.db, volume_id) @@ -287,7 +287,7 @@ class ExtractVolumeSpecTask(flow_utils.CinderTask): return specs def revert(self, context, result, **kwargs): - if isinstance(result, misc.Failure): + if isinstance(result, ft.Failure): return volume_spec = result.get('volume_spec') # Restore the source volume status and set the volume to error status. -- 2.45.2