ejabberd: Prevent restart on freedombox startup

Closes: #1641

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-09-07 15:43:46 -04:00
1 parent b87930406e
commit 29ae2edcd1
2 files changed
+19 -2

No files matched your search

+13
View File
@@ -20,6 +20,7 @@ Configuration helper for the ejabberd service
"""
import argparse
import json
import os
import pathlib
import shutil
@@ -46,6 +47,10 @@ def parse_arguments():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='subcommand', help='Sub command')
# Get configuration
subparsers.add_parser('get-configuration',
help='Return the current configuration')
# Preseed debconf values before packages are installed.
pre_install = subparsers.add_parser(
'pre-install',
@@ -93,6 +98,14 @@ def parse_arguments():
return parser.parse_args()
def subcommand_get_configuration(_):
"""Return the current configuration, specifically domains configured."""
with open(EJABBERD_CONFIG, 'r') as file_handle:
conf = ruamel.yaml.round_trip_load(file_handle, preserve_quotes=True)
print(json.dumps({'domains': conf['hosts']}))
def subcommand_pre_install(arguments):
"""Preseed debconf values before packages are installed."""
domainname = arguments.domainname