diff --git a/slate/slate.py b/slate/slate.py index d1bc53c..21a983c 100644 --- a/slate/slate.py +++ b/slate/slate.py @@ -106,7 +106,7 @@ class Slate(): def deep_expand_vars(self, dict, **kwargs): self.apply_nested(dict, lambda x: self.expand_vars(x, **kwargs)) - def consume(self, conf, key, default=None, **kwargs): + def consume(self, conf, key, default=None, expand=False, **kwargs): keys_arr = key.split('.') if len(keys_arr) == 1: k = keys_arr[0] @@ -117,7 +117,9 @@ class Slate(): if k in conf: del conf[k] - if type(val) == str: + if expand: + self.deep_expand_vars(val, config=self._config, **kwargs) + elif type(val) == str: while val.find('{') != -1: val = self.expand_vars(val, config=self._config, **kwargs)