diff --git a/Configs/configparsertest_modifiedvalues.cfg b/Configs/configparsertest_modifiedvalues.cfg index b01eafa270d2c41a79103327d92832f3832bfe1c..e0aa7a23e86d4f804395cc3edf6d9d2191622ede 100644 --- a/Configs/configparsertest_modifiedvalues.cfg +++ b/Configs/configparsertest_modifiedvalues.cfg @@ -57,6 +57,7 @@ ProblScalingFactor: 1 ProblDelayLimit: 1 MinSizekB: 1 RemoveSmallFiles: True +SkipSymlinkFiles: True DrivenPool: [{'projecttag': 'ptag', 'targetdir': 'altdest', 'eosinstance': 'eosdriven'}] CopyEnabled: True # this one has to be default, other we can't set the others MaxConcurrentCopy: 10 diff --git a/Script/cs/Threads/ManagerThread.py b/Script/cs/Threads/ManagerThread.py index 105ef02ea5de860759598585275b1c917ef8f67f..82ae44288f2ca3df63ceab77998d1163d07e1809 100644 --- a/Script/cs/Threads/ManagerThread.py +++ b/Script/cs/Threads/ManagerThread.py @@ -175,6 +175,10 @@ class ManagerThread(threading.Thread): Constants.copying_ext, Constants.problematic_ext): continue + if self.conf.SkipSymlinkFiles and os.path.islink(filename): + self.logger.debug('skipping symlink file: %s', filename) + continue + if filename in self.managedfiles: self.logger.debug('file already managed: %s', filename) continue diff --git a/Script/cs/Tools/ConfigParser.py b/Script/cs/Tools/ConfigParser.py index 53371a4ba0aec74e1553a7ef1420809c29de86e1..9c429ddc9e40a9ecd478e2d7c59f8f3ea1a63f21 100644 --- a/Script/cs/Tools/ConfigParser.py +++ b/Script/cs/Tools/ConfigParser.py @@ -335,6 +335,12 @@ class ConfigHolder(object): except AttributeError: self.RemoveSmallFiles = False + # Skip files that are symlinks + try: + self.SkipSymlinkFiles = cfg.SkipSymlinkFiles + except AttributeError: + self.SkipSymlinkFiles = False + # Directory where to copy the Data Files (string) # Keywords from the filename parser can be used here self.CopyDir = cfg.CopyDir diff --git a/UnitTests/ConfigParser_Test.py b/UnitTests/ConfigParser_Test.py index 1a6e496bbe1bee8ef021dd3dd81898c18f57f408..66662297dc997af42fced0e087c3076cd20dbbd6 100644 --- a/UnitTests/ConfigParser_Test.py +++ b/UnitTests/ConfigParser_Test.py @@ -71,6 +71,7 @@ class TestConfigHolder(unittest.TestCase): self.assert_equal_del('ProblDelayLimit', 36000) self.assert_equal_del('MinSizekB', None) self.assert_equal_del('RemoveSmallFiles', False) + self.assert_equal_del('SkipSymlinkFiles', False) self.assert_equal_del('DrivenPool', []) self.assert_equal_del('CopyEnabled', True) self.assert_equal_del('MaxConcurrentCopy', 1) @@ -179,6 +180,7 @@ class TestConfigHolder(unittest.TestCase): self.assert_equal_del('ProblDelayLimit', 1) self.assert_equal_del('MinSizekB', 1) self.assert_equal_del('RemoveSmallFiles', True) + self.assert_equal_del('SkipSymlinkFiles', True) # DrivenPool is not straightforward to check self.assertEqual(type(self.c.DrivenPool), type([]))