From 7c2b4f86a6e710c1941e388e81640a1919fc6f03 Mon Sep 17 00:00:00 2001 From: Adrian Moennich Date: Fri, 5 May 2017 14:37:04 +0200 Subject: [PATCH] Storage/XRootD: Support additional options e.g. `xrd.k5ccname=/path/to/ticket` note: using such options currently breaks authentication due to url encoding (see inveniosoftware/xrootdpyfs#79) --- storage_xrootd/indico_storage_xrootd.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/storage_xrootd/indico_storage_xrootd.py b/storage_xrootd/indico_storage_xrootd.py index 8873a417a..523e71827 100644 --- a/storage_xrootd/indico_storage_xrootd.py +++ b/storage_xrootd/indico_storage_xrootd.py @@ -52,15 +52,20 @@ class XRootDStorage(Storage): def __init__(self, data): data = self._parse_data(data) self.xrootd_host = data['host'] + self.xrootd_opts = data.get('opts', '') self.path = data['root'] self.fuse = bool(ast.literal_eval(data.get('fuse', 'False').title())) @return_ascii def __repr__(self): - return ''.format(self.xrootd_host, self.path) + qs = '?{}'.format(self.xrootd_opts) if self.xrootd_opts else '' + return ''.format(self.xrootd_host, self.path, qs) def _get_xrootd_fs(self): - return XRootDPyFS('root://{}//'.format(self.xrootd_host)) + uri = 'root://{}//'.format(self.xrootd_host) + if self.xrootd_opts: + uri += '?' + self.xrootd_opts + return XRootDPyFS(uri) def _resolve_path(self, path): full_path = safe_join(self.path, path)