Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ILCDIRAC
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CLICdp
iLCDirac
ILCDIRAC
Merge requests
!197
[WIP] TransferDataAgent
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
[WIP] TransferDataAgent
hazafar/ILCDIRAC:transferDataAgent
into
Rel-v28r0
Overview
1
Commits
1
Pipelines
2
Changes
3
Closed
Hamza Zafar
requested to merge
hazafar/ILCDIRAC:transferDataAgent
into
Rel-v28r0
6 years ago
Overview
1
Commits
1
Pipelines
2
Changes
3
Expand
BEGINRELEASENOTES
*DataManagementSystem NEW: Transfer Data Agent
ENDRELEASENOTES
0
0
Merge request reports
Compare
Rel-v28r0
version 1
da24297a
6 years ago
Rel-v28r0 (base)
and
latest version
latest version
10942241
1 commit,
6 years ago
version 1
da24297a
1 commit,
6 years ago
3 files
+
263
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
DataManagementSystem/Agent/RequestOperations/RemoveReplicaWithCheck.py
0 → 100644
+
49
−
0
Options
__RCSID__
=
"
$Id $
"
from
DIRAC
import
S_OK
from
DIRAC.DataManagementSystem.Agent.RequestOperations.RemoveReplica
import
RemoveReplica
from
DIRAC.FrameworkSystem.Client.MonitoringClient
import
gMonitor
from
DIRAC.Resources.Catalog.FileCatalogClient
import
FileCatalogClient
class
RemoveReplicaWithCheck
(
RemoveReplica
):
"""
RemoveReplicaWithCheck class
"""
def
__init__
(
self
,
operation
=
None
,
csPath
=
None
):
"""
c
'
tor
:param self: self reference
:param Operation operation: operation to execute
:param str csPath: CS path for this handler
"""
# # base class ctor
RemoveReplica
.
__init__
(
self
,
operation
,
csPath
)
self
.
fcClient
=
FileCatalogClient
()
def
__call__
(
self
):
"""
remove replicas
"""
sourceSE
=
self
.
operation
.
SourceSE
targetSE
=
self
.
operation
.
TargetSE
fileIndices
=
[]
for
i
in
range
(
len
(
self
.
operation
)):
opFile
=
self
.
operation
[
i
]
lfn
=
opFile
.
LFN
res
=
self
.
fcClient
.
getReplicas
(
lfn
)
if
not
res
[
'
OK
'
]:
self
.
log
.
error
(
'
Failed to get replicas for LFN: %s, Error: %s
'
%
(
lfn
,
res
[
'
Message
'
]))
continue
self
.
log
.
info
(
res
[
'
Value
'
])
if
sourceSE
not
in
res
[
'
Value
'
][
'
Successful
'
][
lfn
]:
self
.
log
.
warn
(
'
File %s is lost on %s, skip removal from se %s
'
%
(
lfn
,
sourceSE
,
targetSE
))
fileIndices
.
append
(
i
)
if
self
.
TargetSE
not
in
res
[
'
Value
'
][
'
Successful
'
][
lfn
]:
self
.
log
.
warn
(
'
File %s is already removed from %s
'
%
self
.
TargetSE
)
for
index
in
fileIndices
:
del
self
.
operation
[
index
]
return
super
(
RemoveReplicaWithCheck
,
self
).
__call__
()
Loading