Skip to content

Commit

Permalink
Fix referenced before assignment in sysvinit module (#42695)
Browse files Browse the repository at this point in the history
* Fix referenced before assignment in sysvinit module

* removed redundant variable initialization
  • Loading branch information
MichaelMayorov authored and bcoca committed Aug 15, 2018
1 parent 9d5ce3d commit 7538a63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ansible/modules/system/sysvinit.py
Expand Up @@ -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)
Expand Down

0 comments on commit 7538a63

Please sign in to comment.