[elbe-devel] [PATCH 6/6] elbepack: xmlpreprocess: use helper for boolean attributes

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue May 28 10:26:26 CEST 2024


Both "true" and "1" are valid values. Use the helper to recognize both.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/xmlpreprocess.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elbepack/xmlpreprocess.py b/elbepack/xmlpreprocess.py
index 881d293f1b68..56a714018782 100644
--- a/elbepack/xmlpreprocess.py
+++ b/elbepack/xmlpreprocess.py
@@ -24,6 +24,7 @@ from elbepack.config import cfg
 from elbepack.directories import run_elbe
 from elbepack.isooptions import iso_option_valid
 from elbepack.schema import xml_schema_file
+from elbepack.treeutils import xml_bool
 from elbepack.validate import error_log_to_strings
 
 
@@ -104,8 +105,7 @@ def preprocess_iso_option(xml):
     if src_opts is None:
         return
 
-    strict = ('strict' in src_opts.attrib
-              and src_opts.attrib['strict'] == 'true')
+    strict = xml_bool(src_opts.attrib.get('strict'))
 
     for opt in src_opts.iterfind('./*'):
         valid = iso_option_valid(opt.tag, opt.text)

-- 
2.45.1



More information about the elbe-devel mailing list