Skip to content

Commit

Permalink
Merge branch 'master' of github.com:proycon/clam
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Mar 15, 2018
2 parents 37d62ca + 958bd71 commit af1f4aa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions clam/common/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io
import json
import time
import re
import yaml
from copy import copy
from lxml import etree as ElementTree
Expand Down Expand Up @@ -2480,6 +2481,12 @@ def loadconfig(callername, required=True):
with io.open(configfile,'r', encoding='utf-8') as f:
data = yaml.safe_load(f.read())
for key, value in data.items():
#replace variables
if '{' in value:
variables = re.findall("\{\{\w+\}\}")
for v in variables:
if v.strip('{}') in os.environ:
value = value.replace(v,os.environ[v.strip('{}')])
setattr(settingsmodule,key.upper(), value)
return True

Expand Down

0 comments on commit af1f4aa

Please sign in to comment.