mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
slurp: PEP8, imports, cosmetics (#24677)
- Make PEP8 compliant - Ensure imports are specific - Few cosmetic changes (sort lists, casing, punctuation)
This commit is contained in:
parent
ea27baf7ff
commit
37bfca23c9
2 changed files with 13 additions and 17 deletions
|
@ -22,8 +22,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.0',
|
||||||
'status': ['stableinterface'],
|
'status': ['stableinterface'],
|
||||||
'supported_by': 'core'}
|
'supported_by': 'core'}
|
||||||
|
|
||||||
|
DOCUMENTATION = r'''
|
||||||
DOCUMENTATION = '''
|
|
||||||
---
|
---
|
||||||
module: slurp
|
module: slurp
|
||||||
version_added: historical
|
version_added: historical
|
||||||
|
@ -37,21 +36,18 @@ options:
|
||||||
- The file on the remote system to fetch. This I(must) be a file, not a
|
- The file on the remote system to fetch. This I(must) be a file, not a
|
||||||
directory.
|
directory.
|
||||||
required: true
|
required: true
|
||||||
default: null
|
|
||||||
aliases: []
|
|
||||||
notes:
|
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
|
- 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.
|
original file size.
|
||||||
- "See also: M(fetch)"
|
- "See also: M(fetch)"
|
||||||
requirements: []
|
|
||||||
author:
|
author:
|
||||||
- "Ansible Core Team"
|
- Ansible Core Team
|
||||||
- "Michael DeHaan"
|
- Michael DeHaan (@mpdehaan)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r'''
|
||||||
# Find out what the remote machine's mounts are:
|
- name: Find out what the remote machine's mounts are
|
||||||
- slurp:
|
slurp:
|
||||||
src: /proc/mounts
|
src: /proc/mounts
|
||||||
register: mounts
|
register: mounts
|
||||||
|
|
||||||
|
@ -71,13 +67,17 @@ EXAMPLES = '''
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
|
import os
|
||||||
|
|
||||||
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec = dict(
|
argument_spec=dict(
|
||||||
src = dict(required=True, aliases=['path'], type='path'),
|
src=dict(type='path', required=True, aliases=['path']),
|
||||||
),
|
),
|
||||||
supports_check_mode=True
|
supports_check_mode=True,
|
||||||
)
|
)
|
||||||
source = module.params['src']
|
source = module.params['src']
|
||||||
|
|
||||||
|
@ -90,9 +90,6 @@ def main():
|
||||||
|
|
||||||
module.exit_json(content=data, source=source, encoding='base64')
|
module.exit_json(content=data, source=source, encoding='base64')
|
||||||
|
|
||||||
# import module snippets
|
|
||||||
from ansible.module_utils.basic import *
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
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_command.py
|
||||||
lib/ansible/modules/network/asa/asa_config.py
|
lib/ansible/modules/network/asa/asa_config.py
|
||||||
lib/ansible/modules/net_tools/basics/get_url.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/net_tools/basics/uri.py
|
||||||
lib/ansible/modules/network/bigswitch/bigmon_chain.py
|
lib/ansible/modules/network/bigswitch/bigmon_chain.py
|
||||||
lib/ansible/modules/network/bigswitch/bigmon_policy.py
|
lib/ansible/modules/network/bigswitch/bigmon_policy.py
|
||||||
|
|
Loading…
Reference in a new issue