Add support check mode for all info modules

As it's required by new ansible-test rules.
See https://github.com/ansible-collections/overview/issues/45#issuecomment-893543025
Change-Id: Ib6b73e810b972997b8de2b4a9eb8e07e246823d5
This commit is contained in:
Sagi Shnaidman 2021-08-16 13:21:27 +03:00
parent 770b283593
commit 2d554d1e22
19 changed files with 52 additions and 3 deletions

View File

@ -174,7 +174,8 @@ class ComputeFlavorInfoModule(OpenStackModule):
['name', 'ram'],
['name', 'vcpus'],
['name', 'ephemeral']
]
],
supports_check_mode=True
)
deprecated_names = ('openstack.cloud.compute_flavor_facts')

View File

@ -136,6 +136,9 @@ class DnsZoneInfoModule(OpenStackModule):
description=dict(required=False, type='str'),
ttl=dict(required=False, type='int')
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):

View File

@ -150,6 +150,9 @@ class FloatingIPInfoModule(OpenStackModule):
router=dict(required=False),
status=dict(required=False, choices=['active', 'down']),
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):

View File

@ -92,7 +92,8 @@ class IdentityDomainInfoModule(OpenStackModule):
module_kwargs = dict(
mutually_exclusive=[
['name', 'filters'],
]
],
supports_check_mode=True
)
deprecated_names = ('openstack.cloud.identity_domain_facts')

View File

@ -119,6 +119,9 @@ class IdentityGroupInfoModule(OpenStackModule):
domain=dict(required=False, default=None),
filters=dict(required=False, type='dict', default=None),
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):
name = self.params['name']

View File

@ -116,6 +116,9 @@ class IdentityUserInfoModule(OpenStackModule):
domain=dict(required=False, default=None),
filters=dict(required=False, type='dict', default=None),
)
module_kwargs = dict(
supports_check_mode=True
)
deprecated_names = ('openstack.cloud.identity_user_facts')

View File

@ -157,6 +157,9 @@ class ImageInfoModule(OpenStackModule):
image=dict(type='str', required=False),
properties=dict(type='dict', required=False),
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):

View File

@ -115,6 +115,9 @@ class KeyPairInfoModule(OpenStackModule):
limit=dict(type='int', required=False),
marker=dict(type='str', required=False)
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):
name = self.params['name']

View File

@ -124,6 +124,9 @@ class NetworkInfoModule(OpenStackModule):
name=dict(required=False, default=None),
filters=dict(required=False, type='dict', default=None)
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):

View File

@ -188,6 +188,7 @@ class NetworkPortInfoModule(OpenStackModule):
filters=dict(type='dict', required=False),
)
module_kwargs = dict(
supports_check_mode=True
)
deprecated_names = ('openstack.cloud.port_facts')

View File

@ -155,6 +155,9 @@ class RouterInfoModule(OpenStackModule):
name=dict(required=False, default=None),
filters=dict(required=False, type='dict', default=None)
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):

View File

@ -148,6 +148,9 @@ class SecurityGroupInfoModule(OpenStackModule):
not_tags=dict(required=False, type='list', elements='str'),
not_any_tags=dict(required=False, type='list', elements='str')
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):
description = self.params['description']

View File

@ -177,7 +177,8 @@ class SecurityGroupRuleInfoModule(OpenStackModule):
module_kwargs = dict(
mutually_exclusive=[
['remote_ip_prefix', 'remote_group'],
]
],
supports_check_mode=True
)
def run(self):

View File

@ -70,6 +70,9 @@ class ServerInfoModule(OpenStackModule):
filters=dict(required=False, type='dict', default=None),
all_projects=dict(required=False, type='bool', default=False),
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):

View File

@ -80,6 +80,9 @@ class StackInfoModule(OpenStackModule):
project_id=dict(required=False, type='str'),
owner_id=dict(required=False, type='str')
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):
data = []

View File

@ -140,6 +140,9 @@ class SubnetInfoModule(OpenStackModule):
name=dict(required=False, default=None, aliases=['subnet']),
filters=dict(required=False, type='dict', default=None)
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):
kwargs = self.check_versioned(

View File

@ -90,6 +90,9 @@ class VolumeBackupInfoModule(OpenStackModule):
name=dict(required=False, type='str'),
volume=dict(required=False, type='str')
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):
name_filter = self.params['name']

View File

@ -124,6 +124,9 @@ class VolumeInfoModule(OpenStackModule):
name=dict(type='str', required=False),
status=dict(type='str', required=False),
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):
kwargs = self.check_versioned(

View File

@ -96,6 +96,9 @@ class VolumeSnapshotInfoModule(OpenStackModule):
'deleting', 'error_deleting', 'rollbacking',
'backing-up']),
)
module_kwargs = dict(
supports_check_mode=True
)
def run(self):