mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
Update validate-modules (#20932)
* Update validate-modules * Validates ANSIBLE_METADATA * Ensures imports happen after documentation vars * Some pep8 cleanup * Clean up some left over unneeded code * Update modules for new module guidelines and validate-modules checks * Update imports for ec2_vpc_route_table and ec2_vpc_nat_gateway
This commit is contained in:
parent
1718719d77
commit
829c0b8f62
178 changed files with 1849 additions and 1783 deletions
|
@ -21,8 +21,6 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import re
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -79,6 +77,8 @@ EXAMPLES = '''
|
|||
url: 'https://bitbucket.org/telemachus/brew'
|
||||
'''
|
||||
|
||||
import re
|
||||
|
||||
|
||||
def a_valid_tap(tap):
|
||||
'''Returns True if the tap is valid.'''
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import shutil
|
||||
from os import path
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -93,7 +90,8 @@ EXAMPLES = '''
|
|||
state: absent
|
||||
'''
|
||||
|
||||
USERAGENT = 'ansible-httpget'
|
||||
import shutil
|
||||
from os import path
|
||||
|
||||
try:
|
||||
from layman.api import LaymanAPI
|
||||
|
@ -102,6 +100,8 @@ try:
|
|||
except ImportError:
|
||||
HAS_LAYMAN_API = False
|
||||
|
||||
USERAGENT = 'ansible-httpget'
|
||||
|
||||
|
||||
class ModuleError(Exception):
|
||||
pass
|
||||
|
|
|
@ -18,14 +18,6 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import shlex
|
||||
import sqlite3
|
||||
|
||||
from distutils.version import StrictVersion
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -136,6 +128,15 @@ EXAMPLES = '''
|
|||
- openbsd_pkg: name=qt5 quick=yes state=absent
|
||||
'''
|
||||
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import shlex
|
||||
import sqlite3
|
||||
|
||||
from distutils.version import StrictVersion
|
||||
|
||||
|
||||
# Function used for executing commands.
|
||||
def execute_command(cmd, module):
|
||||
# Break command line into arguments.
|
||||
|
|
|
@ -18,14 +18,9 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import json
|
||||
import os
|
||||
from time import sleep
|
||||
|
||||
# import module snippets
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
from ansible.module_utils.urls import url_argument_spec
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
|
@ -192,6 +187,15 @@ repo:
|
|||
sample: my_repo
|
||||
'''
|
||||
|
||||
import json
|
||||
import os
|
||||
from time import sleep
|
||||
|
||||
# import module snippets
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
from ansible.module_utils.urls import url_argument_spec
|
||||
|
||||
|
||||
class pulp_server(object):
|
||||
"""
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: sorcery
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this software. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import re
|
||||
import pipes
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'community',
|
||||
'version': '1.0'}
|
||||
|
@ -77,6 +74,10 @@ EXAMPLES = '''
|
|||
state: absent
|
||||
'''
|
||||
|
||||
import re
|
||||
import pipes
|
||||
|
||||
|
||||
def compare_package(version1, version2):
|
||||
""" Compare version packages.
|
||||
Return values:
|
||||
|
|
|
@ -21,35 +21,6 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
try:
|
||||
import rpm
|
||||
HAS_RPM_PYTHON = True
|
||||
except ImportError:
|
||||
HAS_RPM_PYTHON = False
|
||||
|
||||
try:
|
||||
import yum
|
||||
HAS_YUM_PYTHON = True
|
||||
except ImportError:
|
||||
HAS_YUM_PYTHON = False
|
||||
|
||||
try:
|
||||
from yum.misc import find_unfinished_transactions, find_ts_remaining
|
||||
from rpmUtils.miscutils import splitFilename
|
||||
transaction_helpers = True
|
||||
except:
|
||||
transaction_helpers = False
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['stableinterface'],
|
||||
'supported_by': 'core',
|
||||
'version': '1.0'}
|
||||
|
@ -236,12 +207,41 @@ EXAMPLES = '''
|
|||
register: result
|
||||
'''
|
||||
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
try:
|
||||
import rpm
|
||||
HAS_RPM_PYTHON = True
|
||||
except ImportError:
|
||||
HAS_RPM_PYTHON = False
|
||||
|
||||
try:
|
||||
import yum
|
||||
HAS_YUM_PYTHON = True
|
||||
except ImportError:
|
||||
HAS_YUM_PYTHON = False
|
||||
|
||||
try:
|
||||
from yum.misc import find_unfinished_transactions, find_ts_remaining
|
||||
from rpmUtils.miscutils import splitFilename
|
||||
transaction_helpers = True
|
||||
except:
|
||||
transaction_helpers = False
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
|
||||
# 64k. Number of bytes to read at a time when manually downloading pkgs via a url
|
||||
BUFSIZE = 65536
|
||||
|
||||
def_qf = "%{name}-%{version}-%{release}.%{arch}"
|
||||
rpmbin = None
|
||||
|
||||
|
||||
def yum_base(conf_file=None, installroot='/'):
|
||||
|
||||
my = yum.YumBase()
|
||||
|
|
|
@ -18,13 +18,6 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
import os
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
from ansible.module_utils.six.moves import configparser
|
||||
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['stableinterface'],
|
||||
'supported_by': 'core',
|
||||
'version': '1.0'}
|
||||
|
@ -478,6 +471,11 @@ state:
|
|||
sample: "present"
|
||||
'''
|
||||
|
||||
import os
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
from ansible.module_utils.six.moves import configparser
|
||||
|
||||
|
||||
class YumRepo(object):
|
||||
# Class global variables
|
||||
|
|
|
@ -26,9 +26,6 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from xml.dom.minidom import parseString as parseXML
|
||||
import re
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['preview'],
|
||||
'supported_by': 'committer',
|
||||
'version': '1.0'}
|
||||
|
@ -178,6 +175,9 @@ EXAMPLES = '''
|
|||
ZYPP_LOCK_TIMEOUT: 20
|
||||
'''
|
||||
|
||||
from xml.dom.minidom import parseString as parseXML
|
||||
import re
|
||||
|
||||
|
||||
def split_name_version(name):
|
||||
"""splits of the package name and desired version
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue