retire shade in favor of openstacksdk for openstack modules (#40532)

* Establish connection through openstacksdk
* Switch from shade to openstacksdk
* fix typo in link to openstacksdk
* remove nova_client usage
* further remove of min_version from openstack modules
This commit is contained in:
Artem Goncharov 2018-05-26 03:40:39 +02:00 committed by Monty Taylor
commit 89ce826a9f
51 changed files with 266 additions and 321 deletions

View file

@ -72,7 +72,7 @@ options:
availability_zone:
description:
- Ignored. Present for backwards compatibility
requirements: ["shade"]
requirements: ["openstacksdk"]
'''
EXAMPLES = '''
@ -383,11 +383,6 @@ def main():
supports_check_mode=True,
**module_kwargs)
if module.params['project']:
min_version = '1.10.0'
else:
min_version = None
state = module.params['state']
name = module.params['name']
network = module.params['network']
@ -396,7 +391,7 @@ def main():
if module.params['external_fixed_ips'] and not network:
module.fail_json(msg='network is required when supplying external_fixed_ips')
shade, cloud = openstack_cloud_from_module(module, min_version=min_version)
sdk, cloud = openstack_cloud_from_module(module)
try:
if project is not None:
proj = cloud.get_project(project)
@ -482,7 +477,7 @@ def main():
cloud.delete_router(router_id)
module.exit_json(changed=True)
except shade.OpenStackCloudException as e:
except sdk.exceptions.OpenStackCloudException as e:
module.fail_json(msg=str(e))