From 2406b144fa0573264e1559bcf573982f789627b5 Mon Sep 17 00:00:00 2001 From: pycat Date: Thu, 13 Apr 2017 13:21:50 +0300 Subject: [PATCH] firewall: Fix 500 error when firewalld is not running (Closes: #748) - Added one more condition to check whether the output is empty or not --- plinth/modules/firewall/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plinth/modules/firewall/__init__.py b/plinth/modules/firewall/__init__.py index 1161d7f0c..7ba78a480 100644 --- a/plinth/modules/firewall/__init__.py +++ b/plinth/modules/firewall/__init__.py @@ -65,7 +65,10 @@ def setup(helper, old_version=None): def get_enabled_status(): """Return whether firewall is enabled""" output = _run(['get-status'], superuser=True) - return output.split()[0] == 'running' + if not output: + return False + else: + return output.split()[0] == 'running' def get_enabled_services(zone):