Allow empty default/error value in substitution

This commit is contained in:
Mohamed Akram 2020-05-13 14:28:33 +04:00 committed by Muayyad Alsadi
parent 0ac75fd361
commit 64ed554543

View File

@ -146,8 +146,8 @@ def fix_mount_dict(mount_dict, proj_name, srv_name):
# $$ means $ # $$ means $
var_re = re.compile(r'\$(\{(?:[^\s\$:\-\}]+)\}|(?:[^\s\$\{\}]+))') var_re = re.compile(r'\$(\{(?:[^\s\$:\-\}]+)\}|(?:[^\s\$\{\}]+))')
var_def_re = re.compile(r'\$\{([^\s\$:\-\}]+)(:)?-([^\}]+)\}') var_def_re = re.compile(r'\$\{([^\s\$:\-\}]+)(:)?-([^\}]*)\}')
var_err_re = re.compile(r'\$\{([^\s\$:\-\}]+)(:)?\?([^\}]+)\}') var_err_re = re.compile(r'\$\{([^\s\$:\-\}]+)(:)?\?([^\}]*)\}')
def dicts_get(dicts, key, fallback='', fallback_empty=False): def dicts_get(dicts, key, fallback='', fallback_empty=False):
""" """