Skip to content

Commit

Permalink
Merge pull request #169 from tmaeno/master
Browse files Browse the repository at this point in the history
$env in cacher
  • Loading branch information
tmaeno authored Jan 10, 2023
2 parents e7236fe + 887c863 commit 92d42ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions pandaharvester/harvesterbody/cacher.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import re
import os
import json
import shutil
import datetime
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pandaharvester/panda_pkg_info.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version = "0.2.23"
release_version = "0.2.24"

0 comments on commit 92d42ed

Please sign in to comment.