mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
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:
parent
e16490c9c0
commit
89ce826a9f
51 changed files with 266 additions and 321 deletions
|
@ -64,7 +64,7 @@ options:
|
|||
availability_zone:
|
||||
description:
|
||||
- Ignored. Present for backwards compatibility
|
||||
requirements: ["shade"]
|
||||
requirements: ["openstacksdk"]
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
@ -168,15 +168,15 @@ def _ports_match(protocol, module_min, module_max, rule_min, rule_max):
|
|||
Capture the complex port matching logic.
|
||||
|
||||
The port values coming in for the module might be -1 (for ICMP),
|
||||
which will work only for Nova, but this is handled by shade. Likewise,
|
||||
which will work only for Nova, but this is handled by sdk. Likewise,
|
||||
they might be None, which works for Neutron, but not Nova. This too is
|
||||
handled by shade. Since shade will consistently return these port
|
||||
handled by sdk. Since sdk will consistently return these port
|
||||
values as None, we need to convert any -1 values input to the module
|
||||
to None here for comparison.
|
||||
|
||||
For TCP and UDP protocols, None values for both min and max are
|
||||
represented as the range 1-65535 for Nova, but remain None for
|
||||
Neutron. Shade returns the full range when Nova is the backend (since
|
||||
Neutron. sdk returns the full range when Nova is the backend (since
|
||||
that is how Nova stores them), and None values for Neutron. If None
|
||||
values are input to the module for both values, then we need to adjust
|
||||
for comparison.
|
||||
|
@ -288,7 +288,7 @@ def main():
|
|||
remote_group = module.params['remote_group']
|
||||
changed = False
|
||||
|
||||
shade, cloud = openstack_cloud_from_module(module)
|
||||
sdk, cloud = openstack_cloud_from_module(module)
|
||||
try:
|
||||
secgroup = cloud.get_security_group(security_group)
|
||||
|
||||
|
@ -328,7 +328,7 @@ def main():
|
|||
|
||||
module.exit_json(changed=changed)
|
||||
|
||||
except shade.OpenStackCloudException as e:
|
||||
except sdk.exceptions.OpenStackCloudException as e:
|
||||
module.fail_json(msg=str(e))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue