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

Merge pull request #1676 from dagwieers/service-action-fix

The vars stop/start were intended as strings
This commit is contained in:
Daniel Hokka Zakrisson 2012-11-24 15:16:30 -08:00
commit 1ec2a59073

View file

@ -327,8 +327,8 @@ class LinuxService(Service):
if self.action is not "restart": if self.action is not "restart":
rc_state, stdout, stderr = self.execute_command("%s %s %s" % (svc_cmd, self.action, self.arguments)) rc_state, stdout, stderr = self.execute_command("%s %s %s" % (svc_cmd, self.action, self.arguments))
else: else:
rc1, stdout1, stderr1 = self.execute_command("%s %s %s" % (svc_cmd, stop, self.arguments)) rc1, stdout1, stderr1 = self.execute_command("%s %s %s" % (svc_cmd, 'stop', self.arguments))
rc2, stdout2, stderr2 = self.execute_command("%s %s %s" % (svc_cmd, start, self.arguments)) rc2, stdout2, stderr2 = self.execute_command("%s %s %s" % (svc_cmd, 'start', self.arguments))
if rc1 != 0 and rc2 == 0: if rc1 != 0 and rc2 == 0:
rc_state = rc + rc2 rc_state = rc + rc2
stdout = stdout2 stdout = stdout2