Cleanup hostname change fix and clarify log message

This commit is contained in:
James Valleroy 2016-11-02 22:08:33 -04:00
parent 063190a00c
commit 3fa243ef5b
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 4 additions and 6 deletions

View File

@ -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.

View File

@ -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()