mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
config: Send hostname change signal only after fully processing it
If the domain name is not properly set before calling post_hostname_change signal, then in the signal handlers config.get_domainname() returns an empty string. So, call the post_hostname_change signal only after fully finishing the hostname related changes, that is, after setting back the original domain name too. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
e8e2aaf85b
commit
855a99cc21
@ -134,12 +134,12 @@ def set_hostname(hostname):
|
||||
LOGGER.info('Changing hostname to - %s', hostname)
|
||||
actions.superuser_run('hostname-change', [hostname])
|
||||
|
||||
post_hostname_change.send_robust(
|
||||
sender='config', old_hostname=old_hostname, new_hostname=hostname)
|
||||
|
||||
LOGGER.info('Setting domain name after hostname change - %s', domainname)
|
||||
actions.superuser_run('domainname-change', [domainname])
|
||||
|
||||
post_hostname_change.send_robust(
|
||||
sender='config', old_hostname=old_hostname, new_hostname=hostname)
|
||||
|
||||
|
||||
def set_domainname(domainname, old_domainname):
|
||||
"""Sets machine domain name to domainname"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user