mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-23 00:30:22 -07:00
Remove wildcard imports
Made the following changes: * Removed wildcard imports * Replaced long form of GPL header with short form * Removed get_exception usage * Added from __future__ boilerplate * Adjust division operator to // where necessary For the following files: * web_infrastructure modules * system modules * linode, lxc, lxd, atomic, cloudscale, dimensiondata, ovh, packet, profitbricks, pubnub, smartos, softlayer, univention modules * compat dirs (disabled as its used intentionally)
This commit is contained in:
parent
f6d7fc548e
commit
4e6cce354e
185 changed files with 1657 additions and 3459 deletions
|
@ -2,21 +2,11 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# (c) 2016, Gregory Shulov (gregory.shulov@gmail.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': ['preview'],
|
||||
|
@ -52,6 +42,8 @@ options:
|
|||
required: true
|
||||
extends_documentation_fragment:
|
||||
- infinibox
|
||||
requirements:
|
||||
- capacity
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
@ -69,14 +61,14 @@ EXAMPLES = '''
|
|||
RETURN = '''
|
||||
'''
|
||||
|
||||
HAS_INFINISDK = True
|
||||
try:
|
||||
from infinisdk import InfiniBox, core
|
||||
from capacity import KiB, Capacity
|
||||
HAS_CAPACITY = True
|
||||
except ImportError:
|
||||
HAS_INFINISDK = False
|
||||
HAS_CAPACITY = False
|
||||
|
||||
from ansible.module_utils.infinibox import *
|
||||
from capacity import KiB, Capacity
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.infinibox import HAS_INFINISDK, api_wrapper, get_system, infinibox_argument_spec
|
||||
|
||||
|
||||
@api_wrapper
|
||||
|
@ -145,6 +137,8 @@ def main():
|
|||
|
||||
if not HAS_INFINISDK:
|
||||
module.fail_json(msg='infinisdk is required for this module')
|
||||
if not HAS_CAPACITY:
|
||||
module.fail_json(msg='The capacity python library is required for this module')
|
||||
|
||||
if module.params['size']:
|
||||
try:
|
||||
|
@ -170,7 +164,5 @@ def main():
|
|||
module.exit_json(changed=False)
|
||||
|
||||
|
||||
# Import Ansible Utilities
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue