mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +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
|
||||
|
||||
@@ -84,7 +85,10 @@ options:
|
||||
- Name of the tenant whose subnet has to be attached.
|
||||
required: false
|
||||
default: None
|
||||
requirements: ["quantumclient", "keystoneclient"]
|
||||
requirements:
|
||||
- "python >= 2.6"
|
||||
- "python-neutronclient or python-quantumclient"
|
||||
- "python-keystoneclient"
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
@@ -224,6 +228,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)
|
||||
_set_tenant_id(module)
|
||||
@@ -253,5 +259,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