From 95cbff27a9f27ce7d0a661c8548c2a408f96e5a2 Mon Sep 17 00:00:00 2001 From: kload Date: Sat, 31 Oct 2015 13:58:02 +0100 Subject: [PATCH] [fix] Allow yunohost firewall service to be run even if YunoHost is unconfigured --- data/actionsmap/yunohost.yml | 3 +++ src/yunohost/firewall.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index 867404fd0..053aee467 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -1017,6 +1017,9 @@ firewall: reload: action_help: Reload all firewall rules api: PUT /firewall + configuration: + authenticate: false + lock: false ### firewall_allow() allow: diff --git a/src/yunohost/firewall.py b/src/yunohost/firewall.py index c0b06e64b..59c6a1a03 100644 --- a/src/yunohost/firewall.py +++ b/src/yunohost/firewall.py @@ -199,6 +199,10 @@ def firewall_reload(): reloaded = False errors = False + # Do not continue if YunoHost is not configured + try: open('/etc/yunohost/installed') + except IOError: return True + # Check if SSH port is allowed ssh_port = _get_ssh_port() if ssh_port not in firewall_list()['opened_ports']: