Fix syntax error
authorLorin Hochstein <lhochstein@netflix.com>
Wed, 11 Jan 2017 07:00:45 +0000 (23:00 -0800)
committerLorin Hochstein <lhochstein@netflix.com>
Wed, 11 Jan 2017 07:00:45 +0000 (23:00 -0800)
Remove trailing digits in module

ch10/playbooks/library/can_reach

index fbfe520..3c78849 100644 (file)
@@ -1,29 +1,29 @@
 #!/usr/bin/python
 
 def can_reach(module, host, port, timeout):
-    nc_path = module.get_bin_path('nc', required=True) 1
+    nc_path = module.get_bin_path('nc', required=True)
     args = [nc_path, "-z", "-w", str(timeout),
             host, str(port)]
-    (rc, stdout, stderr) = module.run_command(args) 2
+    (rc, stdout, stderr) = module.run_command(args)
     return rc == 0
 
 def main():
-    module = AnsibleModule( 3
-        argument_spec=dict( 4
-            host=dict(required=True), 5
+    module = AnsibleModule(
+        argument_spec=dict(
+            host=dict(required=True),
             port=dict(required=True, type='int'),
-            timeout=dict(required=False, type='int', default=3) 6
+            timeout=dict(required=False, type='int', default=3)
         ),
-        supports_check_mode=True 7
+        supports_check_mode=True
     )
 
     # In check mode, we take no action
     # Since this module never changes system state, we just
     # return changed=False
-    if module.check_mode: 8
-        module.exit_json(changed=False) 9
+    if module.check_mode:
+        module.exit_json(changed=False)
 
-    host = module.params['host'] 10
+    host = module.params['host']
     port = module.params['port']
     timeout = module.params['timeout']
 
@@ -31,7 +31,7 @@ def main():
         module.exit_json(changed=False)
     else:
         msg = "Could not reach %s:%s" % (host, port)
-        module.fail_json(msg=msg) 11
+        module.fail_json(msg=msg)
 
-from ansible.module_utils.basic import * 12
+from ansible.module_utils.basic import *
 main()