@@ -17,18 +17,22 @@ def getOS():
17
17
osv = subprocess .check_output (shlex .split (cmd ), encoding = "utf-8" ).rstrip ()
18
18
return osv
19
19
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"""
25
22
osv = getOS ()
26
23
rucio_path = f'/cvmfs/cms.cern.ch/rucio/x86_64/rhel{ osv } /py3/current'
27
24
os .environ ['RUCIO_HOME' ] = rucio_path
28
25
os .environ ['RUCIO_ACCOUNT' ] = user
29
26
full_rucio_path = glob .glob (rucio_path + '/lib/python*.*' )[0 ]
30
27
sys .path .insert (0 ,full_rucio_path + '/site-packages/' )
31
28
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
+
32
36
warnings .filterwarnings ("ignore" , message = ".*cryptography.*" )
33
37
from rucio .client .client import Client # pylint: disable=import-error,import-outside-toplevel
34
38
client = Client ()
0 commit comments