diff options
author | Nick Daly <nick.m.daly@gmail.com> | 2013-01-10 18:33:02 -0800 |
---|---|---|
committer | Nick Daly <nick.m.daly@gmail.com> | 2013-01-10 18:33:02 -0800 |
commit | 5ceeded54e77419d63319301ff669ca11c172e34 (patch) | |
tree | 5b8dcf304b5d0ffe8ba01fb2e44f4c3b10e84ce5 /modules | |
parent | 8e16374136b5d230edc1cb049f30dc4ca6e88f78 (diff) | |
parent | b54a4906e67e6e35a571c754865c1a517722674f (diff) |
Merge pull request #7 from tomgalloway/master
Fix to allow hostname to be updated on Ubuntu.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/installed/system/config.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/installed/system/config.py b/modules/installed/system/config.py index 01c4ec6..b671fcc 100644 --- a/modules/installed/system/config.py +++ b/modules/installed/system/config.py @@ -10,6 +10,7 @@ import cfg from forms import Form from model import User from util import * +import platform class Config(PagePlugin): def __init__(self, *args, **kwargs): @@ -49,7 +50,10 @@ def set_hostname(hostname): # don't persist/cache change unless it was saved successfuly sys_store = filedict_con(cfg.store_file, 'sys') sys_store['hostname'] = hostname - cfg.exmachina.initd.restart("hostname.sh") # is hostname.sh debian-only? + if platform.linux_distribution()[0]=="Ubuntu" : + cfg.exmachina.service.start("hostname") + else: + cfg.exmachina.initd.restart("hostname.sh") # is hostname.sh debian-only? except OSError, e: raise cherrypy.HTTPError(500, "Hostname restart failed: %s" % e) |