Skip to content
Snippets Groups Projects
Commit 4dabb12b authored by Florent Thiery's avatar Florent Thiery
Browse files

Abort install if repo not configured #21550

parent b7646bd1
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import utils
import os
def setup(interactive=True):
# Create / update admin account
utils.log('Checking admin account')
utils.log('Installing webconf')
cmds = list()
cmds.append('apt-get install python3-ubicast-webconf')
# Set password if any
settings = {
"password": utils.get_conf('WEBCONF_PWD', 'changeme'),
"port": utils.get_conf('WEBCONF_PORT', '9999'),
......@@ -17,3 +17,8 @@ def setup(interactive=True):
d = f.read()
with open('/etc/webconf.json', 'w') as f:
f.write(d.format(**settings))
utils.log('/etc/webconf.json written')
if not os.path.exists('/etc/apt/sources.list.d/skyreach.list'):
raise Exception('skyreach repository not available, cannot install package python3-ubicast-webconf')
else:
utils.run_commands(cmds)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment