Set current domainname again after hostname change

This commit is contained in:
mridulnagpal authored and James Valleroy committed 2016-11-02 21:49:35 -04:00
1 parent b7293e8d98
commit 063190a00c
1 file changed
+7
+7
View File
@@ -234,6 +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()
# Hostname should be ASCII. If it's unicode but passed our
# valid_hostname check, convert to ASCII.
@@ -250,7 +251,13 @@ 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)
actions.superuser_run('domainname-change', [domainname])
def set_domainname(domainname):
"""Sets machine domain name to domainname"""
old_domainname = get_domainname()