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

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue May 28 10:26:24 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/finetuning.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index d19e2c6ff215..60cb6718df97 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -203,7 +203,7 @@ class AddUserAction(FinetuningAction):
                 options.extend(['-g',  att['gid']])
             if 'home' in att:
                 options.extend(['-d',  att['home']])
-            if 'system' in att and att['system'] == 'true':
+            if self.node.bool_attr('system'):
                 options.append('-r')
             if 'create_home' in att and att['create_home'] == 'false':
                 options.append('-M')
@@ -279,7 +279,7 @@ class AddFileAction(FinetuningAction):
 
         content = AddFileAction.decode(content, encoding)
 
-        if 'append' in att and att['append'] == 'true':
+        if self.node.bool_attr('append'):
             target.append_file(dst, content)
         else:
             target.write_file(dst, None, content)

-- 
2.45.1



More information about the elbe-devel mailing list