~patrick-hetu/charms/precise/postgresql/fix-1224668

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/core/host.py

  • Committer: Mark Mims
  • Date: 2013-08-26 20:26:39 UTC
  • mfrom: (48.2.21 cleanups)
  • Revision ID: mark.mims@canonical.com-20130826202639-wz09ds1ohp307p7r
merging lp:~stub/charms/precise/postgresql/cleanups as per https://code.launchpad.net/~stub/charms/precise/postgresql/cleanups/+merge/181738

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
 
22
22
def service_start(service_name):
23
 
    service('start', service_name)
 
23
    return service('start', service_name)
24
24
 
25
25
 
26
26
def service_stop(service_name):
27
 
    service('stop', service_name)
 
27
    return service('stop', service_name)
28
28
 
29
29
 
30
30
def service_restart(service_name):
31
 
    service('restart', service_name)
 
31
    return service('restart', service_name)
32
32
 
33
33
 
34
34
def service_reload(service_name, restart_on_failure=False):
35
 
    if not service('reload', service_name) and restart_on_failure:
36
 
        service('restart', service_name)
 
35
    service_result = service('reload', service_name)
 
36
    if not service_result and restart_on_failure:
 
37
        service_result = service('restart', service_name)
 
38
    return service_result
37
39
 
38
40
 
39
41
def service(action, service_name):