From 7538a63f70c331f41f82510864e551fe403382fe Mon Sep 17 00:00:00 2001 From: Michael Mayorov Date: Wed, 15 Aug 2018 16:59:03 +0300 Subject: [PATCH] Fix referenced before assignment in sysvinit module (#42695) * Fix referenced before assignment in sysvinit module * removed redundant variable initialization --- lib/ansible/modules/system/sysvinit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/system/sysvinit.py b/lib/ansible/modules/system/sysvinit.py index a5067838c80..c3a3932c35f 100644 --- a/lib/ansible/modules/system/sysvinit.py +++ b/lib/ansible/modules/system/sysvinit.py @@ -175,12 +175,12 @@ def main(): # figure out started status, everyone does it different! is_started = False + worked = False # user knows other methods fail and supplied pattern if pattern: - is_started = get_ps(module, pattern) + worked = is_started = get_ps(module, pattern) else: - worked = False if location.get('service'): # standard tool that has been 'destandarized' by reimplementation in other OS/distros cmd = '%s %s status' % (location['service'], name)