Commit 42ff7bd6 authored by Zoltan Mathe's avatar Zoltan Mathe
Browse files

Merge branch 'v8r5-PhC-170306' into 'master'

[v8r5] Fix PluginUtilities

See merge request !296
parents c6492f78 3189df60
......@@ -24,7 +24,7 @@ from LHCbDIRAC.ResourceStatusSystem.Client.ResourceManagementClient import Resou
__RCSID__ = "$Id$"
def __stripNumDirectory( dirName ):
def _stripNumDirectory( dirName ):
while True:
subDir = os.path.basename( dirName )
if subDir and not subDir.isdigit():
......@@ -1040,7 +1040,7 @@ class PluginUtilities( DIRACPluginUtilities ):
for dirName in directories:
# We strip off any numerical directory as we don't care about which productions created the files
# If not we may have only a few input files from a single production and then we would find there is almost nothing prestaged
dirList.add( __stripNumDirectory( dirName ) )
dirList.add( _stripNumDirectory( dirName ) )
# Add possibility to throttle the frequency of the plugin, but not clear if this is useful
period = self.getPluginParam( 'Period', 0 )
now = datetime.datetime.utcnow()
......@@ -1071,7 +1071,7 @@ class PluginUtilities( DIRACPluginUtilities ):
return res
recentFiles = dict.fromkeys( destSEs, 0 )
for fileDict in res['Value']:
dirName = __stripNumDirectory( os.path.dirname( fileDict['LFN'] ) )
dirName = _stripNumDirectory( os.path.dirname( fileDict['LFN'] ) )
usedSE = fileDict['UsedSE']
if dirName in dirList and usedSE in destSEs:
recentFiles[usedSE] += 1
......@@ -1082,7 +1082,7 @@ class PluginUtilities( DIRACPluginUtilities ):
return res
limitTime = datetime.datetime.now() - datetime.timedelta( hours = 12 )
for fileDict in res['Value']:
dirName = __stripNumDirectory( os.path.dirname( fileDict['LFN'] ) )
dirName = _stripNumDirectory( os.path.dirname( fileDict['LFN'] ) )
usedSE = fileDict['UsedSE']
if dirName in dirList and usedSE in destSEs and fileDict['LastUpdate'] > limitTime:
recentFiles[usedSE] += 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment