mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
Fix differences with devel.
This commit is contained in:
parent
1c9a58a885
commit
c709b22e5c
32 changed files with 78 additions and 237 deletions
|
@ -22,8 +22,9 @@ try:
|
|||
except ImportError:
|
||||
from quantumclient.quantum import client
|
||||
from keystoneclient.v2_0 import client as ksclient
|
||||
HAVE_DEPS = True
|
||||
except ImportError:
|
||||
print("failed=True msg='quantumclient (or neutronclient) and keystoneclient are required'")
|
||||
HAVE_DEPS = False
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['deprecated'],
|
||||
'supported_by': 'community',
|
||||
|
@ -119,7 +120,10 @@ options:
|
|||
- From the subnet pool the last IP that should be assigned to the virtual machines
|
||||
required: false
|
||||
default: None
|
||||
requirements: ["quantumclient", "neutronclient", "keystoneclient"]
|
||||
requirements:
|
||||
- "python >= 2.6"
|
||||
- "python-neutronclient or python-quantumclient"
|
||||
- "python-keystoneclient"
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
@ -278,6 +282,9 @@ def main():
|
|||
allocation_pool_end = dict(default=None),
|
||||
))
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
if not HAVE_DEPS:
|
||||
module.fail_json(msg='python-keystoneclient and either python-neutronclient or python-quantumclient are required')
|
||||
|
||||
neutron = _get_neutron_client(module, module.params)
|
||||
_set_tenant_id(module)
|
||||
if module.params['state'] == 'present':
|
||||
|
@ -298,5 +305,6 @@ def main():
|
|||
# this is magic, see lib/ansible/module.params['common.py
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.openstack import *
|
||||
main()
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue