Merge pull request #1096 from sfromm/issue1067

Ignore failure of stop command if start succeeds with state=restarted
reviewable/pr18780/r1
Michael DeHaan 12 years ago
commit dd6f02dcb5

@ -225,6 +225,7 @@ def main():
# =========================================== # ===========================================
# run change commands if we need to # run change commands if we need to
if changed: if changed:
if state in ['started', 'running']: if state in ['started', 'running']:
rc_state, stdout, stderr = _run("%s %s start" % (SERVICE, name)) rc_state, stdout, stderr = _run("%s %s start" % (SERVICE, name))
elif state == 'stopped': elif state == 'stopped':
@ -234,6 +235,11 @@ def main():
elif state == 'restarted': elif state == 'restarted':
rc1, stdout1, stderr1 = _run("%s %s stop" % (SERVICE, name)) rc1, stdout1, stderr1 = _run("%s %s stop" % (SERVICE, name))
rc2, stdout2, stderr2 = _run("%s %s start" % (SERVICE, name)) rc2, stdout2, stderr2 = _run("%s %s start" % (SERVICE, name))
if rc1 != 0 and rc2 == 0:
rc_state = rc + rc2
stdout = stdout2
stderr = stderr2
else:
rc_state = rc + rc1 + rc2 rc_state = rc + rc1 + rc2
stdout = stdout1 + stdout2 stdout = stdout1 + stdout2
stderr = stderr1 + stderr2 stderr = stderr1 + stderr2

Loading…
Cancel
Save