mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Get rid of more wildcard imports and add boilerplate to more modules
This commit cleans up the following module categories: * messaging * inventory * crypto * commands * clustering * cloud/webfaction * cloud/docker * cloud/digital_ocean
This commit is contained in:
@@ -4,20 +4,11 @@
|
||||
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
|
||||
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.0',
|
||||
'status': ['stableinterface'],
|
||||
@@ -92,11 +83,10 @@ EXAMPLES = '''
|
||||
|
||||
import datetime
|
||||
import glob
|
||||
import shlex
|
||||
import os
|
||||
import shlex
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.six import b
|
||||
|
||||
|
||||
def check_command(module, commandline):
|
||||
@@ -190,14 +180,14 @@ def main():
|
||||
delta = endd - startd
|
||||
|
||||
if out is None:
|
||||
out = b('')
|
||||
out = b''
|
||||
if err is None:
|
||||
err = b('')
|
||||
err = b''
|
||||
|
||||
result = dict(
|
||||
cmd = args,
|
||||
stdout = out.rstrip(b("\r\n")),
|
||||
stderr = err.rstrip(b("\r\n")),
|
||||
stdout = out.rstrip(b"\r\n"),
|
||||
stderr = err.rstrip(b"\r\n"),
|
||||
rc = rc,
|
||||
start = str(startd),
|
||||
end = str(endd),
|
||||
|
||||
Reference in New Issue
Block a user