firewall: Fix 500 error when firewalld is not running (Closes: #748)

- Added one more condition to check whether the output is empty or not
This commit is contained in:
pycat 2017-04-13 13:21:50 +03:00 committed by Sunil Mohan Adapa
parent fab423e652
commit 2406b144fa
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -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):