From 0ca0b25605ebf943945690ef151e6fae6e917edb Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 2 Apr 2020 15:25:35 +0200 Subject: [PATCH] Change option_defaults to being a plain dict rather than a method. --- cdist | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cdist b/cdist index 39568d6..9ce04b4 100755 --- a/cdist +++ b/cdist @@ -934,7 +934,13 @@ class Tree(object): def add_defaults(self, options): """Add the defaults from this into a dict options""" if 'option_defaults' in self.cscript: - for k, v in self.cscript['option_defaults']().items(): + from_cscript = self.cscript['option_defaults'] + if isinstance(from_cscript, dict): + defaults_dict = from_cscript + else: + log("Deprecated cscript option_defaults method; replace with a dict") + defaults_dict = from_cscript() + for k, v in default_dict.items(): if not k in options: options[k] = v -- 2.30.2