Skip to content

Commit 7ddfc7b

Browse files
authored
Merge pull request #5766 from DIRACGridBot/cherry-pick-2-e2628abbc-integration
[sweep:integration] Allow to specify input protocol in the CS
2 parents 94b2c46 + 33596b1 commit 7ddfc7b

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

dirac.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,8 @@ Resources
712712
Access = remote
713713
SpaceToken = LHCb-EOS
714714
WSUrl = /srm/v2/server?SFN=
715+
InputProtocols = file, https, root, srm, gsiftp # Allow to overwrite the list of protocols understood as input
716+
OutputProtocols = file, https, root, srm, gsiftp # Allow to overwrite the list of protocols that can be generated
715717
}
716718
}
717719
}

docs/source/AdministratorGuide/Resources/storage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ There are also a set of plugins based on the `gfal2 libraries <https://dmc-docs.
220220
Default plugin options:
221221

222222
* ``Access``: ``Remote`` or ``Local``. If ``Local``, then this protocol can be used only if we are running at the site to which the SE is associated. Typically, if a site mounts the storage as NFS, the ``file`` protocol can be used.
223-
223+
* InputProtocols/OutputProtocols: a given plugin normally contain a hard coded list of protocol it is able to generate or accept as input. There are however seldom cases (like SRM) where the site configuration may change these lists. These options are here to accomodate for that case.
224224

225225
GRIDFTP Optimisation
226226
^^^^^^^^^^^^^^^^^^^^

src/DIRAC/Resources/Storage/GFAL2_XROOTStorage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class GFAL2_XROOTStorage(GFAL2_StorageBase):
2727
Xroot interface to StorageElement using gfal2
2828
"""
2929

30-
_INPUT_PROTOCOLS = ["file", "root"]
30+
_INPUT_PROTOCOLS = ["file", "root", "xroot"]
3131
_OUTPUT_PROTOCOLS = ["root"]
3232

3333
PROTOCOL_PARAMETERS = GFAL2_StorageBase.PROTOCOL_PARAMETERS + ["SvcClass"]

src/DIRAC/Resources/Storage/StorageBase.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,16 @@ def __init__(self, name, parameterDict):
7878
# be so strict about the possible content.
7979
self._allProtocolParameters = parameterDict
8080

81-
if hasattr(self, "_INPUT_PROTOCOLS"):
81+
if "InputProtocols" in parameterDict:
82+
self.protocolParameters["InputProtocols"] = parameterDict["InputProtocols"].replace(" ", "").split(",")
83+
elif hasattr(self, "_INPUT_PROTOCOLS"):
8284
self.protocolParameters["InputProtocols"] = getattr(self, "_INPUT_PROTOCOLS")
8385
else:
8486
self.protocolParameters["InputProtocols"] = [self.protocolParameters["Protocol"], "file"]
8587

86-
if hasattr(self, "_OUTPUT_PROTOCOLS"):
88+
if "OutputProtocols" in parameterDict:
89+
self.protocolParameters["OutputProtocols"] = parameterDict["OutputProtocols"].replace(" ", "").split(",")
90+
elif hasattr(self, "_OUTPUT_PROTOCOLS"):
8791
self.protocolParameters["OutputProtocols"] = getattr(self, "_OUTPUT_PROTOCOLS")
8892
else:
8993
self.protocolParameters["OutputProtocols"] = [self.protocolParameters["Protocol"]]

0 commit comments

Comments
 (0)