def remove_fc_zone(terminate_connection):
 def decorator(self, *args, **kwargs):
  conn_info = terminate_connection(self, *args, **kwargs)
  if (not conn_info):
   LOG.warning(_LW("Driver didn't return connection info from terminate_connection call."))
   return None
  vol_type = conn_info.get('driver_volume_type', None)
  if (vol_type == 'fibre_channel'):
   if ('initiator_target_map' in conn_info['data']):
    zm = create_zone_manager()
    if zm:
     LOG.debug('remove_fc_zone connection info: %(conninfo)s.', {'conninfo': conn_info})
     zm.delete_connection(conn_info)
  return conn_info
 return decorator

def remove_fc_zone ( terminate_connection ) : def decorator ( self , * args , ** kwargs ) : conn_info = terminate_connection ( self , * args , ** kwargs ) if ( not conn_info ) : LOG . warning ( _LW ( "Driver didn't return connection info from terminate_connection call." ) ) return None vol_type = conn_info . get ( 'driver_volume_type' , None ) if ( vol_type == 'fibre_channel' ) : if ( 'initiator_target_map' in conn_info [ 'data' ] ) : zm = create_zone_manager ( ) if zm : LOG . debug ( 'remove_fc_zone connection info: %(conninfo)s.' , { 'conninfo' : conn_info } ) zm . delete_connection ( conn_info ) return conn_info return decorator
decorator for fc drivers to remove zone .