mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Postinstall bugfix
This commit is contained in:
parent
8f12b330b0
commit
3fb93e9e69
1 changed files with 13 additions and 0 deletions
13
yunohost.tac
13
yunohost.tac
|
@ -193,6 +193,13 @@ def favicon(request):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def is_installed(request):
|
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.setHeader('Access-Control-Allow-Origin', '*') # Allow cross-domain requests
|
||||||
request.setResponseCode(200, 'OK')
|
request.setResponseCode(200, 'OK')
|
||||||
return json.dumps({ 'installed': installed })
|
return json.dumps({ 'installed': installed })
|
||||||
|
@ -216,6 +223,12 @@ def main():
|
||||||
action_map = yaml.load(f)
|
action_map = yaml.load(f)
|
||||||
|
|
||||||
# Register only postinstall action if YunoHost isn't completely set up
|
# 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']
|
del action_map['general_arguments']
|
||||||
for category, category_params in action_map.items():
|
for category, category_params in action_map.items():
|
||||||
api.register('ALL', '/api/'+ category, api_doc)
|
api.register('ALL', '/api/'+ category, api_doc)
|
||||||
|
|
Loading…
Add table
Reference in a new issue