def _rmtree(parent, ignore_nocleanup=False, msg='', level=logging.DEBUG, ignore_if_missing=False):
 if (ignore_if_missing and (not os.path.exists(parent))):
  return
 try:
  if (ignore_nocleanup or (not config.nocleanup)):
   log_msg = 'Deleting'
   if msg:
    log_msg += (' (%s)' % msg)
   _logger.log(level, '%s: %s', log_msg, parent)
   shutil.rmtree(parent)
 except Exception as e:
  _logger.debug('In _rmtree, encountered exception: %s(%s)', type(e), e)
  if os.path.exists(parent):
   try:
    _logger.info('placing "delete.me" in %s', parent)
    open(os.path.join(parent, 'delete.me'), 'w').close()
   except Exception as ee:
    _logger.warning('Failed to remove or mark cache directory %s for removal %s', parent, ee)

def _rmtree ( parent , ignore_nocleanup = False , msg = '' , level = logging . DEBUG , ignore_if_missing = False ) : if ( ignore_if_missing and ( not os . path . exists ( parent ) ) ) : return try : if ( ignore_nocleanup or ( not config . nocleanup ) ) : log_msg = 'Deleting' if msg : log_msg += ( ' (%s)' % msg ) _logger . log ( level , '%s: %s' , log_msg , parent ) shutil . rmtree ( parent ) except Exception as e : _logger . debug ( 'In _rmtree, encountered exception: %s(%s)' , type ( e ) , e ) if os . path . exists ( parent ) : try : _logger . info ( 'placing "delete.me" in %s' , parent ) open ( os . path . join ( parent , 'delete.me' ) , 'w' ) . close ( ) except Exception as ee : _logger . warning ( 'Failed to remove or mark cache directory %s for removal %s' , parent , ee )
on nfs filesystems .