Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Marko Petric
LHCbDIRAC
Commits
42ff7bd6
Commit
42ff7bd6
authored
Mar 09, 2017
by
Zoltan Mathe
Browse files
Merge branch 'v8r5-PhC-170306' into 'master'
[v8r5] Fix PluginUtilities See merge request !296
parents
c6492f78
3189df60
Changes
1
Hide whitespace changes
Inline
Side-by-side
LHCbDIRAC/TransformationSystem/Utilities/PluginUtilities.py
View file @
42ff7bd6
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment