ejabberd: Ensure that hosts are not duplicated in configuration

This is non-essential as there seems to be no problem for ejabberd with
duplicated host names.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2019-08-02 12:23:53 -07:00 committed by James Valleroy
parent 76725a0068
commit 0d0ee32a87
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -237,6 +237,8 @@ def subcommand_change_domainname(arguments):
conf['hosts'].append(
ruamel.yaml.scalarstring.DoubleQuotedScalarString(domainname))
conf['hosts'] = list(set(conf['hosts']))
with open(EJABBERD_CONFIG, 'w') as file_handle:
ruamel.yaml.round_trip_dump(conf, file_handle)