slurp: PEP8, imports, cosmetics (#24677)

- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
pull/24692/head
Dag Wieers 8 years ago committed by John R Barker
parent ea27baf7ff
commit 37bfca23c9

@ -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()

@ -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

Loading…
Cancel
Save