Ticket #657: bcfg2-dir-unlink.diff

File bcfg2-dir-unlink.diff, 676 bytes (added by Torsten Rehn <[email protected]…>, 13 years ago)

patch for more graceful dir unlink failure

  • src/lib/Client/Tools/POSIX.py

     
    279279        if entry.get('prune', 'false') == 'true' and entry.get("qtest"): 
    280280            for pname in entry.get("qtest").split(":"): 
    281281                ulfailed = False 
     282                if os.path.isdir(pname): 
     283                    self.logger.info("Not removing extra directory %s, please check and remove manually" % pname) 
     284                    continue 
    282285                try: 
    283286                    self.logger.debug("Unlinking file %s" % pname) 
    284287                    os.unlink(pname)