Skip to content

Commit d7cc593

Browse files
authored
Merge pull request #2 from boegel/download-bar
add CHECKSUMS_JSON constant for 'checksums.json'
2 parents 777a00e + 9b12b1b commit d7cc593

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

easybuild/framework/easyblock.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@
128128
# Directory name in which to store reproducibility files
129129
REPROD = 'reprod'
130130

131+
CHECKSUMS_JSON = 'checksums.json'
132+
131133
_log = fancylogger.getLogger('easyblock')
132134

133135

@@ -139,7 +141,7 @@ def wrapper(*args, **kwargs):
139141
filename = args[1]
140142

141143
# We don't account for the checksums file in the progress bar
142-
if filename != 'checksums.json':
144+
if filename != CHECKSUMS_JSON:
143145
update_progress_bar(PROGRESS_BAR_DOWNLOAD_ALL)
144146

145147
return result
@@ -467,7 +469,7 @@ def get_checksums_from_json(self, always_read=False):
467469
:param always_read: always read the checksums.json file, even if it has been read before
468470
"""
469471
if always_read or self.json_checksums is None:
470-
path = self.obtain_file("checksums.json", no_download=True, warning_only=True)
472+
path = self.obtain_file(CHECKSUMS_JSON, no_download=True, warning_only=True)
471473
if path is not None:
472474
self.log.info("Loading checksums from file %s", path)
473475
json_txt = read_file(path)
@@ -828,7 +830,7 @@ def obtain_file(self, filename, extension=False, urls=None, download_filename=No
828830
srcpaths = source_paths()
829831

830832
# We don't account for the checksums file in the progress bar
831-
if filename != 'checksums.json':
833+
if filename != CHECKSUMS_JSON:
832834
update_progress_bar(PROGRESS_BAR_DOWNLOAD_ALL, progress_size=0, label=filename)
833835

834836
if alt_location is None:
@@ -5058,7 +5060,7 @@ def inject_checksums_to_json(ecs, checksum_type):
50585060
raise EasyBuildError("Found existing checksum for %s, use --force to overwrite them" % filename)
50595061

50605062
# actually write the checksums
5061-
with open(os.path.join(ec_dir, 'checksums.json'), 'w') as outfile:
5063+
with open(os.path.join(ec_dir, CHECKSUMS_JSON), 'w') as outfile:
50625064
json.dump(existing_checksums, outfile, indent=2, sort_keys=True)
50635065

50645066

0 commit comments

Comments
 (0)