From 85b8538e0e0ad950f342424d7a18394614a7e02b Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sun, 23 Jun 2013 09:19:27 +0200 Subject: [PATCH] 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 --- library/system/service | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/system/service b/library/system/service index 54a386ebd1..e83bd19982 100644 --- a/library/system/service +++ b/library/system/service @@ -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