mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Merge Hostname fix.
This commit is contained in:
commit
a9c6b17624
@ -49,9 +49,13 @@ def get_hostname():
|
||||
|
||||
def set_hostname(hostname):
|
||||
"Sets machine hostname to hostname"
|
||||
|
||||
# Hostname should be ASCII. If it's unicode but passed our valid_hostname check, convert to ASCII.
|
||||
hostname = str(hostname)
|
||||
|
||||
cfg.log.info("Changing hostname to '%s'" % hostname)
|
||||
try:
|
||||
privilegedaction_run("hostname-change", [hostname])
|
||||
privilegedaction_run("hostname-change", hostname)
|
||||
# don't persist/cache change unless it was saved successfuly
|
||||
sys_store = filedict_con(cfg.store_file, 'sys')
|
||||
sys_store['hostname'] = hostname
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user