From 509c330f53f012f67f19e79b8702bb2af1e15b21 Mon Sep 17 00:00:00 2001 From: Christopher Johnston Date: Wed, 28 Mar 2012 16:06:26 -0700 Subject: [PATCH] add support for running and started - both will do the same thing --- library/service | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/service b/library/service index d45da40867..f0e5da101b 100755 --- a/library/service +++ b/library/service @@ -44,7 +44,8 @@ for x in items: name = params['name'] state = params.get('state','unknown') -if state not in [ 'running', 'stopped', 'restarted' ]: +# running and started are the same +if state not in [ 'running', 'started', 'stopped', 'restarted' ]: print "failed=True msg='invalid state'" sys.exit(1) @@ -82,10 +83,9 @@ def _run(cmd): stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) - rc = 0 if changed: - if state == 'started': + if state in ('started', 'running'): rc = _run("/sbin/service %s start" % name) elif state == 'stopped': rc = _run("/sbin/service %s stop" % name)