mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
use exmachina to configure timezone
This commit is contained in:
parent
53d1d8f280
commit
09fbb23e90
@ -1,4 +1,4 @@
|
||||
import os, shutil, subprocess
|
||||
import os, subprocess
|
||||
from socket import gethostname
|
||||
import cherrypy
|
||||
import simplejson as json
|
||||
@ -132,8 +132,8 @@ class general(FormPlugin, PagePlugin):
|
||||
message += msg
|
||||
if time_zone != sys_store['time_zone']:
|
||||
src = os.path.join("/usr/share/zoneinfo", time_zone)
|
||||
cfg.log.info("Copying %s to /etc/localtime" % src)
|
||||
shutil.copy(src, "/etc/localtime")
|
||||
cfg.log.info("Setting timezone to %s" % time_zone)
|
||||
cfg.exmachina.misc.set_timezone(time_zone)
|
||||
sys_store['time_zone'] = time_zone
|
||||
return message or "Settings updated."
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user