diff --git a/lib/ansible/modules/net_tools/basics/slurp.py b/lib/ansible/modules/net_tools/basics/slurp.py index eed1721353..298b065d4f 100644 --- a/lib/ansible/modules/net_tools/basics/slurp.py +++ b/lib/ansible/modules/net_tools/basics/slurp.py @@ -22,8 +22,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['stableinterface'], 'supported_by': 'core'} - -DOCUMENTATION = ''' +DOCUMENTATION = r''' --- module: slurp version_added: historical @@ -37,21 +36,18 @@ options: - The file on the remote system to fetch. This I(must) be a file, not a directory. required: true - default: null - aliases: [] notes: - This module returns an 'in memory' base64 encoded version of the file, take into account that this will require at least twice the RAM as the original file size. - "See also: M(fetch)" -requirements: [] author: - - "Ansible Core Team" - - "Michael DeHaan" + - Ansible Core Team + - Michael DeHaan (@mpdehaan) ''' -EXAMPLES = ''' -# Find out what the remote machine's mounts are: -- slurp: +EXAMPLES = r''' +- name: Find out what the remote machine's mounts are + slurp: src: /proc/mounts register: mounts @@ -71,13 +67,17 @@ EXAMPLES = ''' ''' import base64 +import os + +from ansible.module_utils.basic import AnsibleModule + def main(): module = AnsibleModule( - argument_spec = dict( - src = dict(required=True, aliases=['path'], type='path'), + argument_spec=dict( + src=dict(type='path', required=True, aliases=['path']), ), - supports_check_mode=True + supports_check_mode=True, ) source = module.params['src'] @@ -90,9 +90,6 @@ def main(): module.exit_json(content=data, source=source, encoding='base64') -# import module snippets -from ansible.module_utils.basic import * if __name__ == '__main__': main() - diff --git a/test/sanity/pep8/legacy-files.txt b/test/sanity/pep8/legacy-files.txt index 6ff5061210..75fd99ec1f 100644 --- a/test/sanity/pep8/legacy-files.txt +++ b/test/sanity/pep8/legacy-files.txt @@ -408,7 +408,6 @@ lib/ansible/modules/network/asa/asa_acl.py lib/ansible/modules/network/asa/asa_command.py lib/ansible/modules/network/asa/asa_config.py lib/ansible/modules/net_tools/basics/get_url.py -lib/ansible/modules/net_tools/basics/slurp.py lib/ansible/modules/net_tools/basics/uri.py lib/ansible/modules/network/bigswitch/bigmon_chain.py lib/ansible/modules/network/bigswitch/bigmon_policy.py