From 823f2e57e61f3c0588e1ba01fbf5b61931ef7870 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 10 Nov 2026 22:25:29 +0100 Subject: [PATCH] Do not print the firewalld check of confignet systemctl status firewalld printed the unit status, or 'Unit firewalld.service could not be found.' on images without firewalld. --- confluent_osdeploy/common/profile/scripts/confignet | 4 +++- confluent_osdeploy/debian/profiles/default/scripts/confignet | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/common/profile/scripts/confignet b/confluent_osdeploy/common/profile/scripts/confignet index c6b51216..0ca8f222 100644 --- a/confluent_osdeploy/common/profile/scripts/confignet +++ b/confluent_osdeploy/common/profile/scripts/confignet @@ -608,7 +608,9 @@ if __name__ == '__main__': checktarg = None if '-c' in sys.argv: checktarg = sys.argv[sys.argv.index('-c') + 1] - havefirewall = subprocess.call(['systemctl', 'status', 'firewalld']) + # quiet: images without firewalld print an error otherwise + with open(os.devnull, 'w') as devnull: + havefirewall = subprocess.call(['systemctl', 'status', 'firewalld'], stdout=devnull, stderr=devnull) havefirewall = havefirewall == 0 if havefirewall: subprocess.check_call(['systemctl', 'stop', 'firewalld']) diff --git a/confluent_osdeploy/debian/profiles/default/scripts/confignet b/confluent_osdeploy/debian/profiles/default/scripts/confignet index 25591b08..02b9c1ec 100644 --- a/confluent_osdeploy/debian/profiles/default/scripts/confignet +++ b/confluent_osdeploy/debian/profiles/default/scripts/confignet @@ -489,7 +489,9 @@ class NetworkManager(object): if __name__ == '__main__': - havefirewall = subprocess.call(['systemctl', 'status', 'firewalld']) + # quiet: images without firewalld print an error otherwise + with open(os.devnull, 'w') as devnull: + havefirewall = subprocess.call(['systemctl', 'status', 'firewalld'], stdout=devnull, stderr=devnull) havefirewall = havefirewall == 0 if havefirewall: subprocess.check_call(['systemctl', 'stop', 'firewalld'])