<s> import logging <EOL> from util import full_stack <EOL> from workflow . steps . util . base import BaseStep <EOL> from workflow . exceptions . error_codes import DBAAS_0021 <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class UpdateDbaaSMetadata ( BaseStep ) : <EOL> def __unicode__ ( self ) : <EOL> return "<STR_LIT>" <EOL> def do ( self , workflow_dict ) : <EOL> try : <EOL> volume = workflow_dict [ '<STR_LIT>' ] <EOL> old_volume = workflow_dict [ '<STR_LIT>' ] <EOL> old_volume . is_active = False <EOL> old_volume . save ( ) <EOL> volume . is_active = True <EOL> volume . save ( ) <EOL> return True <EOL> except Exception : <EOL> traceback = full_stack ( ) <EOL> workflow_dict [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( DBAAS_0021 ) <EOL> workflow_dict [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( traceback ) <EOL> return False <EOL> def undo ( self , workflow_dict ) : <EOL> LOG . info ( "<STR_LIT>" ) <EOL> try : <EOL> volume = workflow_dict [ '<STR_LIT>' ] <EOL> old_volume = workflow_dict [ '<STR_LIT>' ] <EOL> old_volume . is_active = True <EOL> old_volume . save ( ) <EOL> volume . is_active = False <EOL> volume . save ( ) <EOL> return True <EOL> except Exception : <EOL> traceback = full_stack ( ) <EOL> workflow_dict [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( DBAAS_0021 ) <EOL> workflow_dict [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( traceback ) <EOL> return False </s>
