mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Resolving differences in core modules post-merge
This commit is contained in:
committed by
Matt Clay
parent
95d59b61eb
commit
8afa090417
@@ -22,6 +22,7 @@ try:
|
||||
except ImportError:
|
||||
from quantumclient.quantum import client
|
||||
from keystoneclient.v2_0 import client as ksclient
|
||||
HAVE_DEPS = True
|
||||
except ImportError:
|
||||
HAVE_DEPS = False
|
||||
|
||||
@@ -79,7 +80,10 @@ options:
|
||||
- Name of the external network which should be attached to the router.
|
||||
required: true
|
||||
default: None
|
||||
requirements: ["quantumclient", "neutronclient", "keystoneclient"]
|
||||
requirements:
|
||||
- "python >= 2.6"
|
||||
- "python-neutronclient or python-quantumclient"
|
||||
- "python-keystoneclient"
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
@@ -192,6 +196,8 @@ def main():
|
||||
state = dict(default='present', choices=['absent', 'present']),
|
||||
))
|
||||
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)
|
||||
router_id = _get_router_id(module, neutron)
|
||||
@@ -220,5 +226,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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user