Skip to content

Commit

Permalink
Storage/XRootD: Support additional options
Browse files Browse the repository at this point in the history
e.g. `xrd.k5ccname=/path/to/ticket`

note: using such options currently breaks authentication due to
url encoding (see inveniosoftware/xrootdpyfs#79)
  • Loading branch information
ThiefMaster committed May 10, 2017
1 parent 06ba97a commit 5e70c78
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions storage_xrootd/indico_storage_xrootd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<XRootDStorage: root://{}/{}>'.format(self.xrootd_host, self.path)
qs = '?{}'.format(self.xrootd_opts) if self.xrootd_opts else ''
return '<XRootDStorage: root://{}/{}{}>'.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)
Expand Down

0 comments on commit 5e70c78

Please sign in to comment.