From c7845456a60dd0041f7fd3ee67453ba1a8e30be3 Mon Sep 17 00:00:00 2001
From: Matt Martz <matt@sivel.net>
Date: Tue, 16 Feb 2016 15:58:44 -0600
Subject: [PATCH] Various simple linting type cleanups on modules

---
 cloud/amazon/ec2_ami.py           | 2 --
 cloud/amazon/ec2_tag.py           | 1 -
 cloud/amazon/ec2_vol.py           | 4 ++--
 cloud/amazon/s3.py                | 1 -
 cloud/vmware/vsphere_guest.py     | 2 +-
 database/mysql/mysql_variables.py | 2 +-
 network/eos/eos_eapi.py           | 3 +--
 system/mount.py                   | 1 -
 system/service.py                 | 4 ++--
 system/sysctl.py                  | 1 -
 windows/win_user.ps1              | 1 +
 11 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/cloud/amazon/ec2_ami.py b/cloud/amazon/ec2_ami.py
index bdb130e2380..f3caa587485 100644
--- a/cloud/amazon/ec2_ami.py
+++ b/cloud/amazon/ec2_ami.py
@@ -243,7 +243,6 @@ def create_image(module, ec2):
             for img in images:
                 if img.name == name:
                     module.exit_json(msg="AMI name already present", image_id=img.id, state=img.state, changed=False)
-                    sys.exit(0)
             else:
                 module.fail_json(msg="Error in retrieving duplicate AMI details")
         else:
@@ -321,7 +320,6 @@ def deregister_image(module, ec2):
         module.fail_json(msg = "timed out waiting for image to be reregistered/deleted")
 
     module.exit_json(msg="AMI deregister/delete operation complete", changed=True)
-    sys.exit(0)
 
 
 def update_image(module, ec2):
diff --git a/cloud/amazon/ec2_tag.py b/cloud/amazon/ec2_tag.py
index 0e005f0fb48..b864329593d 100644
--- a/cloud/amazon/ec2_tag.py
+++ b/cloud/amazon/ec2_tag.py
@@ -175,7 +175,6 @@ def main():
 
     if state == 'list':
         module.exit_json(changed=False, tags=tagdict)
-    sys.exit(0)
 
 # import module snippets
 from ansible.module_utils.basic import *
diff --git a/cloud/amazon/ec2_vol.py b/cloud/amazon/ec2_vol.py
index 6a0d4e8e2c3..668895df9eb 100644
--- a/cloud/amazon/ec2_vol.py
+++ b/cloud/amazon/ec2_vol.py
@@ -406,7 +406,7 @@ def modify_dot_attribute(module, ec2, instance, device_name):
         dot = instance.block_device_mapping[device_name].delete_on_termination
     except boto.exception.BotoServerError, e:
         module.fail_json(msg = "%s: %s" % (e.error_code, e.error_message))
-  
+
     if delete_on_termination != dot:
         try:
             bdt = BlockDeviceType(delete_on_termination=delete_on_termination)
@@ -415,7 +415,7 @@ def modify_dot_attribute(module, ec2, instance, device_name):
 
             ec2.modify_instance_attribute(instance_id=instance.id, attribute='blockDeviceMapping', value=bdm)
 
-	    while instance.block_device_mapping[device_name].delete_on_termination != delete_on_termination:
+            while instance.block_device_mapping[device_name].delete_on_termination != delete_on_termination:
                 time.sleep(3)
                 instance.update()
             changed = True
diff --git a/cloud/amazon/s3.py b/cloud/amazon/s3.py
index 6636069d731..82b9839a2f5 100644
--- a/cloud/amazon/s3.py
+++ b/cloud/amazon/s3.py
@@ -520,7 +520,6 @@ def main():
 
         # Use this snippet to debug through conditionals:
 #       module.exit_json(msg="Bucket return %s"%bucketrtn)
-#       sys.exit(0)
 
         # Lets check the src path.
         pathrtn = path_check(src)
diff --git a/cloud/vmware/vsphere_guest.py b/cloud/vmware/vsphere_guest.py
index 7d9d20d51dd..41a7b63dc80 100644
--- a/cloud/vmware/vsphere_guest.py
+++ b/cloud/vmware/vsphere_guest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/python
 
 # -*- coding: utf-8 -*-
 # This file is part of Ansible
diff --git a/database/mysql/mysql_variables.py b/database/mysql/mysql_variables.py
index 5e551cd0eb3..ff10b4fd1b4 100644
--- a/database/mysql/mysql_variables.py
+++ b/database/mysql/mysql_variables.py
@@ -146,7 +146,7 @@ def main():
     if mysqlvar is None:
         module.fail_json(msg="Cannot run without variable to operate with")
     if match('^[0-9a-z_]+$', mysqlvar) is None:
-	    module.fail_json(msg="invalid variable name \"%s\"" % mysqlvar)
+        module.fail_json(msg="invalid variable name \"%s\"" % mysqlvar)
     if not mysqldb_found:
         module.fail_json(msg="the python mysqldb module is required")
     else:
diff --git a/network/eos/eos_eapi.py b/network/eos/eos_eapi.py
index 5a7e96f2f12..d81a26f9741 100644
--- a/network/eos/eos_eapi.py
+++ b/network/eos/eos_eapi.py
@@ -274,7 +274,6 @@ def main():
 from ansible.module_utils.basic import *
 from ansible.module_utils.shell import *
 from ansible.module_utils.eos import *
+
 if __name__ == '__main__':
     main()
-
-
diff --git a/system/mount.py b/system/mount.py
index ff7094dad3b..d0a6e1c8ee2 100644
--- a/system/mount.py
+++ b/system/mount.py
@@ -380,7 +380,6 @@ def main():
         module.exit_json(changed=changed, **args)
 
     module.fail_json(msg='Unexpected position reached')
-    sys.exit(0)
 
 # import module snippets
 from ansible.module_utils.basic import *
diff --git a/system/service.py b/system/service.py
index 0364766448e..fd46cae9a95 100644
--- a/system/service.py
+++ b/system/service.py
@@ -1172,7 +1172,7 @@ class NetBsdService(Service):
     distribution = None
 
     def get_service_tools(self):
-        initpaths = [ '/etc/rc.d' ]		# better: $rc_directories - how to get in here? Run: sh -c '. /etc/rc.conf ; echo $rc_directories'
+        initpaths = [ '/etc/rc.d' ]  # better: $rc_directories - how to get in here? Run: sh -c '. /etc/rc.conf ; echo $rc_directories'
 
         for initdir in initpaths:
             initscript = "%s/%s" % (initdir,self.name)
@@ -1188,7 +1188,7 @@ class NetBsdService(Service):
         else:
             self.rcconf_value = "NO"
 
-        rcfiles = [ '/etc/rc.conf' ]		# Overkill?
+        rcfiles = [ '/etc/rc.conf' ]  # Overkill?
         for rcfile in rcfiles:
             if os.path.isfile(rcfile):
                 self.rcconf_file = rcfile
diff --git a/system/sysctl.py b/system/sysctl.py
index db1652955fc..5f0e12f5aa3 100644
--- a/system/sysctl.py
+++ b/system/sysctl.py
@@ -356,7 +356,6 @@ def main():
     result = SysctlModule(module)    
 
     module.exit_json(changed=result.changed)
-    sys.exit(0)
 
 # import module snippets
 from ansible.module_utils.basic import *
diff --git a/windows/win_user.ps1 b/windows/win_user.ps1
index ac40ced2cbc..cf3a178c6bb 100644
--- a/windows/win_user.ps1
+++ b/windows/win_user.ps1
@@ -16,6 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
 
+# WANT_JSON
 # POWERSHELL_COMMON
 
 ########