1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Adding better failure output for chkconfig failures rather than

just saying that the service name is unknown
This commit is contained in:
Peter Gehres 2014-02-13 22:47:14 -08:00
parent 22cfef33b4
commit c427a829a0

View file

@ -577,7 +577,7 @@ class LinuxService(Service):
self.execute_command("%s --add %s" % (self.enable_cmd, self.name)) self.execute_command("%s --add %s" % (self.enable_cmd, self.name))
(rc, out, err) = self.execute_command("%s --list %s" % (self.enable_cmd, self.name)) (rc, out, err) = self.execute_command("%s --list %s" % (self.enable_cmd, self.name))
if not self.name in out: if not self.name in out:
self.module.fail_json(msg="unknown service name") self.module.fail_json(msg="service %s does not support chkconfig" % self.name)
state = out.split()[-1] state = out.split()[-1]
if self.enable and ( "3:on" in out and "5:on" in out ): if self.enable and ( "3:on" in out and "5:on" in out ):
return return