Commit efc98a09 by Jeffrey Chu

fail when service cannot be found by chkconfig

parent 2e797a51
......@@ -465,7 +465,7 @@ class LinuxService(Service):
if self.enable_cmd.endswith("chkconfig"):
(rc, out, err) = self.execute_command("%s --list %s" % (self.enable_cmd, self.name))
if not self.name in out:
self.module.exit_json(msg="unknown service name")
self.module.fail_json(msg="unknown service name")
state = out.split()[-1]
if self.enable and ( "3:on" in out and "5:on" in out ):
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment