diff --git a/pandaharvester/harvesterbody/cacher.py b/pandaharvester/harvesterbody/cacher.py index a85fcd23..f7ed9341 100644 --- a/pandaharvester/harvesterbody/cacher.py +++ b/pandaharvester/harvesterbody/cacher.py @@ -1,3 +1,5 @@ +import re +import os import json import shutil import datetime @@ -95,6 +97,15 @@ def _refresh_cache(inputs): def get_data(self, info_url, tmp_log): retStat = False retVal = None + # resolve env variable + match = re.search(r'\$\{*([^\}]+)\}*', info_url) + if match: + var_name = match.group(1) + if var_name not in os.environ: + errMsg = 'undefined environment variable: {}'.format(var_name) + tmp_log.error(errMsg) + else: + info_url = os.environ[var_name] if info_url.startswith('file:'): try: with open(info_url.split(':')[-1], 'r') as infoFile: diff --git a/pandaharvester/panda_pkg_info.py b/pandaharvester/panda_pkg_info.py index 40704d35..d4da338b 100644 --- a/pandaharvester/panda_pkg_info.py +++ b/pandaharvester/panda_pkg_info.py @@ -1 +1 @@ -release_version = "0.2.23" +release_version = "0.2.24"