Resolving differences in core modules post-merge

This commit is contained in:
James Cammarata 2016-12-07 21:33:38 -05:00 committed by Matt Clay
parent 95d59b61eb
commit 8afa090417
115 changed files with 2651 additions and 17913 deletions

View file

@ -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()