connectcore-demo-example: improve is_dual_system()

Fix an issue where the fw_printenv command output includes a trailing newline,
which could lead to incorrect string comparisons. The output is now stripped to
ensure consistent and accurate evaluation.

Example before fix:

>>> res = exec_cmd("fw_printenv -n dualboot")
>>> res
(0, 'yes\n')

https://onedigi.atlassian.net/browse/DEL-9718

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
Isaac Hermida 2025-07-11 18:09:56 +02:00
parent 2a9f9933cf
commit 14911565e8
1 changed files with 1 additions and 1 deletions

View File

@ -1267,7 +1267,7 @@ def is_dual_system():
Boolean: True for dual systems, False otherwise. Boolean: True for dual systems, False otherwise.
""" """
res = exec_cmd("fw_printenv -n dualboot") res = exec_cmd("fw_printenv -n dualboot")
return res[0] == 0 and res[1] == "yes" return res[0] == 0 and res[1].strip() == "yes"
def get_fw_store_path(): def get_fw_store_path():