From 3fb93e9e697feef5cacd5e64e1abf99556a0cbac Mon Sep 17 00:00:00 2001 From: Kload Date: Thu, 21 Nov 2013 11:56:28 +0100 Subject: [PATCH] Postinstall bugfix --- yunohost.tac | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/yunohost.tac b/yunohost.tac index 7a281778..6ece45d1 100755 --- a/yunohost.tac +++ b/yunohost.tac @@ -193,6 +193,13 @@ def favicon(request): return '' def is_installed(request): + global installed + + try: + with open('/etc/yunohost/installed'): + installed = True + except IOError: + installed = False request.setHeader('Access-Control-Allow-Origin', '*') # Allow cross-domain requests request.setResponseCode(200, 'OK') return json.dumps({ 'installed': installed }) @@ -216,6 +223,12 @@ def main(): action_map = yaml.load(f) # Register only postinstall action if YunoHost isn't completely set up + try: + with open('/etc/yunohost/installed'): + installed = True + except IOError: + installed = False + del action_map['general_arguments'] for category, category_params in action_map.items(): api.register('ALL', '/api/'+ category, api_doc)