<s> import logging <EOL> from util import full_stack <EOL> from dbaas_nfsaas . provider import NfsaasProvider <EOL> from workflow . steps . util . base import BaseStep <EOL> from workflow . exceptions . error_codes import DBAAS_0020 <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class RevokeNFSAccess ( BaseStep ) : <EOL> def __unicode__ ( self ) : <EOL> return "<STR_LIT>" <EOL> def do ( self , workflow_dict ) : <EOL> try : <EOL> databaseinfra = workflow_dict [ '<STR_LIT>' ] <EOL> source_host = workflow_dict [ '<STR_LIT>' ] [ <NUM_LIT:0> ] <EOL> target_host = source_host . future_host <EOL> nfsaas_export_id = source_host . nfsaas_host_attributes . all ( ) [ <EOL> <NUM_LIT:0> ] . nfsaas_export_id <EOL> NfsaasProvider . revoke_access ( environment = databaseinfra . environment , <EOL> host = target_host , <EOL> export_id = nfsaas_export_id ) <EOL> return True <EOL> except Exception : <EOL> traceback = full_stack ( ) <EOL> workflow_dict [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( DBAAS_0020 ) <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> return True <EOL> except Exception : <EOL> traceback = full_stack ( ) <EOL> workflow_dict [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( DBAAS_0020 ) <EOL> workflow_dict [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( traceback ) <EOL> return False </s>
