@@ -61,8 +61,9 @@ def load_schedconfig_data(self, pandaqueues=[], priority=[], cache_time=60):
6161
6262 cric_url = getattr (config .Information , 'queues_url' , None ) or 'https://atlas-cric.cern.ch/cache/schedconfig/{pandaqueue}.json'
6363 cric_url = cric_url .format (pandaqueue = pandaqueues [0 ] if len (pandaqueues ) == 1 else 'pandaqueues' )
64+ cvmfs_path = self .get_cvmfs_path (config .Information .queues_cvmfs , 'cric_pandaqueues.json' )
6465
65- sources = {'CVMFS' : {'url' : getattr ( config . Information , 'queues_cvmfs' , None ) or '/cvmfs/atlas.cern.ch/repo/sw/local/etc/cric_pandaqueues.json' ,
66+ sources = {'CVMFS' : {'url' : cvmfs_path ,
6667 'nretry' : 1 ,
6768 'fname' : os .path .join (cache_dir , 'agis_schedconf.cvmfs.json' )},
6869 'CRIC' : {'url' : cric_url ,
@@ -81,6 +82,23 @@ def load_schedconfig_data(self, pandaqueues=[], priority=[], cache_time=60):
8182
8283 return self .load_data (sources , priority , cache_time )
8384
85+ @staticmethod
86+ def get_cvmfs_path (url , fname ):
87+ """
88+ Return a proper path for cvmfs.
89+
90+ :param url: URL (string).
91+ :param fname: file name for CRIC JSON (string).
92+ :return: cvmfs path (string).
93+ """
94+
95+ if url :
96+ cvmfs_path = url .replace ('CVMFS_PATH' , os .environ .get ('ATLAS_SW_BASE' , '/cvmfs' ))
97+ else :
98+ cvmfs_path = '%s/atlas.cern.ch/repo/sw/local/etc/%s' % (os .environ .get ('ATLAS_SW_BASE' , '/cvmfs' ), fname )
99+
100+ return cvmfs_path
101+
84102 @classmethod
85103 def load_queuedata (self , pandaqueue , priority = [], cache_time = 60 ):
86104 """
@@ -113,8 +131,9 @@ def jsonparser_panda(c):
113131
114132 cric_url = getattr (config .Information , 'queues_url' , None ) or 'https://atlas-cric.cern.ch/cache/schedconfig/{pandaqueue}.json'
115133 cric_url = cric_url .format (pandaqueue = pandaqueues [0 ] if len (pandaqueues ) == 1 else 'pandaqueues' )
134+ cvmfs_path = self .get_cvmfs_path (getattr (config .Information , 'queuedata_cvmfs' , None ), 'cric_pandaqueues.json' )
116135
117- sources = {'CVMFS' : {'url' : getattr ( config . Information , 'queuedata_cvmfs' , None ) or '/cvmfs/atlas.cern.ch/repo/sw/local/etc/cric_pandaqueues.json' ,
136+ sources = {'CVMFS' : {'url' : cvmfs_path ,
118137 'nretry' : 1 ,
119138 'fname' : os .path .join (cache_dir , 'agis_schedconf.cvmfs.json' )},
120139 'CRIC' : {'url' : cric_url ,
@@ -159,7 +178,8 @@ def load_storage_data(self, ddmendpoints=[], priority=[], cache_time=60):
159178 cache_dir = os .environ .get ('PILOT_HOME' , '.' )
160179
161180 # list of sources to fetch ddmconf data from
162- sources = {'CVMFS' : {'url' : config .Information .storages_cvmfs or '/cvmfs/atlas.cern.ch/repo/sw/local/etc/cric_ddmendpoints.json' ,
181+ cvmfs_path = self .get_cvmfs_path (config .Information .storages_cvmfs , 'cric_ddmendpoints.json' )
182+ sources = {'CVMFS' : {'url' : cvmfs_path ,
163183 'nretry' : 1 ,
164184 'fname' : os .path .join (cache_dir , getattr (config .Information , 'storages_cache' , None ) or 'agis_ddmendpoints.json' )},
165185 'CRIC' : {'url' : (getattr (config .Information , 'storages_url' , None ) or 'https://atlas-cric.cern.ch/cache/ddmendpoints.json' ),
0 commit comments