Ejemplo n.º 1
0
 def delete_nps_directories(self,dirs):  
   """ Delete the contents of directories with privilege separation NOT in effect."""
   for type in dirs.keys():
     if type in ["client logs", "client proxies",]: 
       common.remove_dir_contents(dirs[type])
       continue
     common.remove_dir_path(dirs[type])
Ejemplo n.º 2
0
  def delete_ps_directories(self,dirs):
    """ Delete the contents of directories with privilege separation in effect."""
    for type in dirs.keys():
      if type not in ["client logs", "client proxies",]: 
        common.remove_dir_path(dirs[type])
        continue
      #-- Factory create requires client logs/proxies directories be empty
      #-- when privspep is in effect
      condor_sbin = "%s/sbin" % self.wms.condor_location()
      condor_bin  = "%s/bin"  % self.wms.condor_location()
      condorExe.set_path(condor_bin,condor_sbin)
      parent_dir = dirs[type]
      subdirs = os.listdir(parent_dir)
      for base_dir in subdirs:
        if os.path.isdir("%s/%s" % (parent_dir,base_dir)): 
          try:
            condorPrivsep.rmtree(parent_dir,base_dir)
          except Exception,e:
            common.logerr("""Encountered a problem in executing condor_root_switchboard 
to remove this client's sub-directories:
  %(dir)s

  %(error)s
Check your /etc/condor/privsep.conf file to verify.
You may need to configure/install your WMS Collector to resolve or correct
the ini file for the %(type)s attribute.  Be careful now.
""" % { "dir"    : parent_dir,
        "type" : type, 
        "error"  : e, } )
          common.logit("Files in %s deleted" % parent_dir)