diff --git a/src/rougail/user_datas.py b/src/rougail/user_datas.py index 0bd75cac3..1d5f86cbd 100644 --- a/src/rougail/user_datas.py +++ b/src/rougail/user_datas.py @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from typing import List from re import findall -from tiramisu import Calculation +from tiramisu import Calculation, owners from tiramisu.error import ( PropertiesOptionError, AttributeOptionError, @@ -46,11 +46,13 @@ class UserDatas: *, return_values_not_error=False, user_datas_type: str="user_datas", + only_default: bool=False, ): self.values = {} self.errors = [] self.warnings = [] self.show_secrets = False + self.only_default = only_default if user_datas_type == "user_datas": self._populate_values(user_datas) else: @@ -198,6 +200,9 @@ class UserDatas: path = option.path() if path not in self.values: continue + if self.only_default and option.owner.get() != owners.default: + self.values.pop(path) + continue options = self.values[path].get("options", {}) if ( options.get("allow_secrets_variables", True) is False