diff --git a/Script/cs/Threads/ManagerThread.py b/Script/cs/Threads/ManagerThread.py index 0d0b9747c738a07ec1f8c68f5a5133b81ed75fa2..b85bc8a5432e16bd96bdb071f1effb351ede9a1d 100644 --- a/Script/cs/Threads/ManagerThread.py +++ b/Script/cs/Threads/ManagerThread.py @@ -327,6 +327,9 @@ class ManagerThread(threading.Thread): elif os.path.isfile(filename + Constants.problematic_ext): infofile = filename + Constants.problematic_ext elif os.path.isfile(filename + Constants.copied_ext): infofile = filename + Constants.copied_ext + # if no file exists, it defaults to TOBECOPIED + new_info_file_extension = Constants.tobecopied_ext + if infofile: self.logger.debug('file: %s, reading info from existing helper file %s', filename, infofile) with open(infofile,'r') as info_file: @@ -353,6 +356,8 @@ class ManagerThread(threading.Thread): ': deleting infofile and getting metadata from scratch' , infofile, remotedir, eosinstance) os.remove(infofile) + # we need to recreate the same file + new_info_file_extension = os.path.splitext(infofile)[1] else: self.logger.debug('filemetadata: remote dir = %s, eos instance = %s', remotedir, eosinstance) @@ -412,7 +417,7 @@ class ManagerThread(threading.Thread): remotedir, eosinstance) fmd = FileMetaData.FileMetaData(filename, remotedir, eosinstance, mtime) - fmd.writeToFile(Constants.tobecopied_ext, self.logger) + fmd.writeToFile(new_info_file_extension, self.logger) return fmd # Normal case @@ -423,7 +428,7 @@ class ManagerThread(threading.Thread): self.logger.debug('normal case, filemetadata: remote dir = %s, eos instance = %s', remotedir, eosinstance) fmd = FileMetaData.FileMetaData(filename, remotedir, eosinstance, mtime) - fmd.writeToFile(Constants.tobecopied_ext, self.logger) + fmd.writeToFile(new_info_file_extension, self.logger) return fmd