Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Commit 96fddb4

Browse files
authored
Merge pull request #363 from PalNilsson/next
2.12.5.4
2 parents 11002a0 + 2fbfdf7 commit 96fddb4

File tree

5 files changed

+30
-10
lines changed

5 files changed

+30
-10
lines changed

PILOTVERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.12.4.24
1+
2.12.5.4

pilot/info/extinfo.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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'),

pilot/util/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# Pilot version
1414
RELEASE = '2' # released number should be fixed at 2 for Pilot 2
1515
VERSION = '12' # version number is '1' for first real Pilot 2 release, '0' until then, increased for bigger updates
16-
REVISION = '4' # revision number should be reset to '1' for every new version release, increased for small updates
17-
BUILD = '24' # build number should be reset to '1' for every new development cycle
16+
REVISION = '5' # revision number should be reset to '1' for every new version release, increased for small updates
17+
BUILD = '4' # build number should be reset to '1' for every new development cycle
1818

1919
SUCCESS = 0
2020
FAILURE = 1

pilot/util/default.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,21 @@ cache_dir:
144144
# default URL value for primary source of Queuedata (can be overwritten via --queuedata-url option)
145145
queuedata_url: http://pandaserver.cern.ch:25085/cache/schedconfig/{pandaqueue}.all.json
146146
# path to queuedata JSON provided by shared filesystem
147-
queuedata_cvmfs: /cvmfs/atlas.cern.ch/repo/sw/local/etc/cric_pandaqueues.json
147+
queuedata_cvmfs: CVMFS_PATH/atlas.cern.ch/repo/sw/local/etc/cric_pandaqueues.json
148148
# local cache filename of the queuedata json
149149
queuedata_cache: queuedata.json
150150

151151
# URL for the PanDA queues API provided by Information system
152152
queues_url: https://atlas-cric.cern.ch/cache/schedconfig/{pandaqueue}.json
153153
# path to PanDA queues JSON provided by shared filesystem
154-
queues_cvmfs: /cvmfs/atlas.cern.ch/repo/sw/local/etc/cric_pandaqueues.json
154+
queues_cvmfs: CVMFS_PATH/atlas.cern.ch/repo/sw/local/etc/cric_pandaqueues.json
155155
# file name of local cache for the PanDA queues JSON
156156
queues_cache: cric_pandaqueues.json
157157

158158
# URL for the DDMEndpoints/storages API provided by Information system
159159
storages_url: https://atlas-cric.cern.ch/cache/ddmendpoints.json
160160
# path to storages JSON cache provided by shared filesystem
161-
storages_cvmfs: /cvmfs/atlas.cern.ch/repo/sw/local/etc/cric_ddmendpoints.json
161+
storages_cvmfs: CVMFS_PATH/atlas.cern.ch/repo/sw/local/etc/cric_ddmendpoints.json
162162
# file name of local cache for the storages JSON
163163
storages_cache: cric_ddmendpoints.json
164164

pilot/util/filehandling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ def get_disk_usage(start_path='.'):
11431143
for f in filenames:
11441144
fp = os.path.join(dirpath, f)
11451145
# skip if it is symbolic link
1146-
if not os.path.islink(fp):
1146+
if os.path.exists(fp) and not os.path.islink(fp):
11471147
total_size += os.path.getsize(fp)
11481148

11491149
return total_size

0 commit comments

Comments
 (0)