mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Add boilerplate and remove wildcard imports for openstack modules (#31461)
* Add boilerplate and remove wildcard imports for openstack modules * Remove openstack files that are now pep8 compliant from the legacy list
This commit is contained in:
@@ -1,20 +1,12 @@
|
||||
#!/usr/bin/python
|
||||
#coding: utf-8 -*-
|
||||
# coding: utf-8 -*-
|
||||
|
||||
# (c) 2013, Benno Joy <benno@ansible.com>
|
||||
#
|
||||
# This module 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.
|
||||
#
|
||||
# This software 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 this software. 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.1',
|
||||
'status': ['preview'],
|
||||
@@ -165,20 +157,21 @@ EXAMPLES = '''
|
||||
ipv6_address_mode: dhcpv6-stateless
|
||||
'''
|
||||
|
||||
from distutils.version import StrictVersion
|
||||
|
||||
try:
|
||||
import shade
|
||||
HAS_SHADE = True
|
||||
except ImportError:
|
||||
HAS_SHADE = False
|
||||
|
||||
|
||||
from distutils.version import StrictVersion
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.openstack import openstack_full_argument_spec, openstack_module_kwargs
|
||||
|
||||
|
||||
def _can_update(subnet, module, cloud):
|
||||
"""Check for differences in non-updatable values"""
|
||||
network_name = module.params['network_name']
|
||||
cidr = module.params['cidr']
|
||||
ip_version = int(module.params['ip_version'])
|
||||
ipv6_ra_mode = module.params['ipv6_ra_mode']
|
||||
ipv6_a_mode = module.params['ipv6_address_mode']
|
||||
@@ -200,6 +193,7 @@ def _can_update(subnet, module, cloud):
|
||||
module.fail_json(msg='Cannot update ipv6_address_mode in existing \
|
||||
subnet')
|
||||
|
||||
|
||||
def _needs_update(subnet, module, cloud):
|
||||
"""Check for differences in the updatable values."""
|
||||
|
||||
@@ -384,8 +378,5 @@ def main():
|
||||
module.fail_json(msg=str(e))
|
||||
|
||||
|
||||
# this is magic, see lib/ansible/module_common.py
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.openstack import *
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user