From adbc6185455bc617d32f548a4921e606c73d98b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 18 Feb 2019 19:43:34 +0100 Subject: [PATCH] Use correct bool properties parsing by default Boolean properties require specific setter to properly handle literal "True" and "False" values. Previously it required all bool properties to include 'setter=qubes.property.bool' in addition to 'type=bool'. This fixes loading some boolean properties from qubes.xml. Specifically at least include_in_backups on DispVM class lacked setter, which resulted in property being reset to True automatically on qubesd restart. Fixes QubesOS/qubes-issues#4831 --- qubes/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qubes/__init__.py b/qubes/__init__.py index e4c339b3..fae5bbb3 100644 --- a/qubes/__init__.py +++ b/qubes/__init__.py @@ -195,6 +195,8 @@ class property: # pylint: disable=redefined-builtin,invalid-name doc=None): # pylint: disable=redefined-builtin self.__name__ = name + if setter is None and type is bool: + setter = qubes.property.bool self._setter = setter self._saver = saver if saver is not None else ( lambda self, prop, value: str(value))