@@ -17,18 +17,22 @@ def getOS():
1717 osv = subprocess .check_output (shlex .split (cmd ), encoding = "utf-8" ).rstrip ()
1818 return osv
1919
20- def getHosted (dataset , user , allow = None , block = None ):
21- """Gets list of files on disk for a dataset, and list of sites along with how many files each site has"""
22- if allow is not None and block is not None :
23- raise RuntimeError ("Cannot specify both allow list and block list, pick one" )
24-
20+ def getRucio (user ):
21+ """Adds Rucio libraries to python path with requisite environment variables"""
2522 osv = getOS ()
2623 rucio_path = f'/cvmfs/cms.cern.ch/rucio/x86_64/rhel{ osv } /py3/current'
2724 os .environ ['RUCIO_HOME' ] = rucio_path
2825 os .environ ['RUCIO_ACCOUNT' ] = user
2926 full_rucio_path = glob .glob (rucio_path + '/lib/python*.*' )[0 ]
3027 sys .path .insert (0 ,full_rucio_path + '/site-packages/' )
3128
29+ def getHosted (dataset , user , allow = None , block = None ):
30+ """Gets list of files on disk for a dataset, and list of sites along with how many files each site has"""
31+ if allow is not None and block is not None :
32+ raise RuntimeError ("Cannot specify both allow list and block list, pick one" )
33+
34+ getRucio (user )
35+
3236 warnings .filterwarnings ("ignore" , message = ".*cryptography.*" )
3337 from rucio .client .client import Client # pylint: disable=import-error,import-outside-toplevel
3438 client = Client ()
0 commit comments