From 3fa243ef5b402910c2c9d6ff9af516b4220ce8c2 Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Wed, 2 Nov 2016 22:08:33 -0400 Subject: [PATCH] Cleanup hostname change fix and clarify log message --- CHANGELOG.md | 1 + plinth/modules/config/config.py | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index caf733e82..2bf025342 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. permissions. Also switch to new setup command. - Include module static files in build, required for Debian package build. - dynamicdns: Allow reading status as non-root. +- config: Set current domainname again after hostname change. ### Changed - repro: Use firewalld provided SIP services. diff --git a/plinth/modules/config/config.py b/plinth/modules/config/config.py index c999f48f3..be60cbf48 100644 --- a/plinth/modules/config/config.py +++ b/plinth/modules/config/config.py @@ -234,7 +234,7 @@ def _apply_changes(request, old_status, new_status): def set_hostname(hostname): """Sets machine hostname to hostname""" old_hostname = get_hostname() - old_domainname = get_domainname() + domainname = get_domainname() # Hostname should be ASCII. If it's unicode but passed our # valid_hostname check, convert to ASCII. @@ -251,13 +251,10 @@ def set_hostname(hostname): old_hostname=old_hostname, new_hostname=hostname) - # Domain name should be ASCII. If it's unicode, convert to ASCII. - domainname = old_domainname - - LOGGER.info('Changing domain name to - %s', domainname) + LOGGER.info('Setting domain name after hostname change - %s', domainname) actions.superuser_run('domainname-change', [domainname]) - + def set_domainname(domainname): """Sets machine domain name to domainname""" old_domainname = get_domainname()