From a355b6a1c98c89f589f51efce31d62fdb0c5c7da Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 10 May 2016 21:57:05 -0700 Subject: [PATCH] Port ping to dual python3/2 compat. --- system/ping.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/ping.py b/system/ping.py index ed93f7dfe11..9939a273c24 100644 --- a/system/ping.py +++ b/system/ping.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan +# (c) 2016, Toshio Kuratomi # # This file is part of Ansible # @@ -40,7 +41,7 @@ EXAMPLES = ''' ansible webservers -m ping ''' -import exceptions +from ansible.module_utils.basic import AnsibleModule def main(): module = AnsibleModule( @@ -52,11 +53,10 @@ def main(): result = dict(ping='pong') if module.params['data']: if module.params['data'] == 'crash': - raise exceptions.Exception("boom") + raise Exception("boom") result['ping'] = module.params['data'] module.exit_json(**result) -from ansible.module_utils.basic import * - -main() +if __name__ == '__main__': + main()