mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Expand usage of Python 2.6 if statement
Syntax like "'foo' if bar else 'baz'" is not supported by all Python versions targetted by Ansible. Hence we break it up. Signed-off-by: martin f. krafft <madduck@madduck.net>
This commit is contained in:
parent
3df2e15277
commit
85b8538e0e
1 changed files with 4 additions and 1 deletions
|
@ -548,7 +548,10 @@ class LinuxService(Service):
|
|||
return
|
||||
|
||||
if self.enable_cmd.endswith("update-rc.d"):
|
||||
action = 'enable' if self.enable else 'disable'
|
||||
if self.enable:
|
||||
action = 'enable'
|
||||
else:
|
||||
action = 'disable'
|
||||
(rc, out, err) = self.execute_command("%s -n %s %s" \
|
||||
% (self.enable_cmd, self.name, action))
|
||||
self.changed = False
|
||||
|
|
Loading…
Reference in a new issue