From 9812081659a5f1c2a720de5454946c9f33df13a0 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 26 Dec 2024 22:05:11 -0700 Subject: [PATCH] python: sd_nspawn: Sort configuration values Signed-off-by: Nathan Chancellor --- python/scripts/sd_nspawn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/scripts/sd_nspawn.py b/python/scripts/sd_nspawn.py index 8c0f09c6..0ba2599b 100755 --- a/python/scripts/sd_nspawn.py +++ b/python/scripts/sd_nspawn.py @@ -132,7 +132,7 @@ def _gen_cfg_str(self): parts.append(f"{subkey}={' '.join(subval)}") # All other list configurations should be joined with the key else: - parts += [f"{subkey}={item}" for item in subval] + parts += [f"{subkey}={item}" for item in sorted(subval)] elif subval: parts.append(f"{subkey}={subval}") parts.append('') @@ -183,7 +183,7 @@ def _gen_eph_cmd(self): if flag == '--system-call-filter': nspawn_cmd.append(f"{flag}={' '.join(value)}") else: - nspawn_cmd += [f"{flag}={item}" for item in value] + nspawn_cmd += [f"{flag}={item}" for item in sorted(value)] # certain configuration options are booleans but the commmand # line option is just a simple flag elif flag in ('--boot', ) and value == 'yes':