Allow to update vars
This commit is contained in:
parent
7089caee97
commit
32ceaca084
@ -8,7 +8,10 @@ class FilterModule(object):
|
|||||||
|
|
||||||
def filters(self):
|
def filters(self):
|
||||||
"""Filters list."""
|
"""Filters list."""
|
||||||
return {"update_env": self.filter_update_env}
|
return {
|
||||||
|
"update_env": self.filter_update_env,
|
||||||
|
"update_vars": self.filter_update_vars,
|
||||||
|
}
|
||||||
|
|
||||||
def filter_update_env(self, config, new_env):
|
def filter_update_env(self, config, new_env):
|
||||||
"""Update the config.env dictionary with new keys."""
|
"""Update the config.env dictionary with new keys."""
|
||||||
@ -19,3 +22,13 @@ class FilterModule(object):
|
|||||||
config["env"][key] = val
|
config["env"][key] = val
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
def filter_update_vars(self, config, new_vars):
|
||||||
|
"""Update the config.vars dictionary with new keys."""
|
||||||
|
if "vars" not in config:
|
||||||
|
return config
|
||||||
|
|
||||||
|
for key, val in new_vars.items():
|
||||||
|
config["vars"][key] = val
|
||||||
|
|
||||||
|
return config
|
||||||
|
Reference in New Issue
Block a user