1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-20 18:59:08 +00:00

Fix module._name comparisons to also consider FQCNs. (#230)

This commit is contained in:
Felix Fontein 2020-04-24 19:55:31 +02:00 committed by GitHub
parent d31b9dfa99
commit 61cf2b74c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 63 additions and 63 deletions

View file

@ -164,7 +164,7 @@ def main():
),
supports_check_mode=True,
)
is_old_facts = module._name == 'hpilo_facts'
is_old_facts = module._name in ('hpilo_facts', 'community.general.hpilo_facts')
if is_old_facts:
module.deprecate("The 'hpilo_facts' module has been renamed to 'hpilo_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')

View file

@ -105,7 +105,7 @@ def main():
argument_spec,
supports_check_mode=True,
)
if module._name == 'intersight_facts':
if module._name in ('intersight_facts', 'community.general.intersight_facts'):
module.deprecate("The 'intersight_facts' module has been renamed to 'intersight_info'", version='2.13')
intersight = IntersightModule(module)

View file

@ -118,7 +118,7 @@ class DatacenterInfoModule(OneViewModuleBase):
def __init__(self):
super(DatacenterInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
self.is_old_facts = self.module._name == 'oneview_datacenter_facts'
self.is_old_facts = self.module._name in ('oneview_datacenter_facts', 'community.general.oneview_datacenter_facts')
if self.is_old_facts:
self.module.deprecate("The 'oneview_datacenter_facts' module has been renamed to 'oneview_datacenter_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')

View file

@ -161,7 +161,7 @@ class EnclosureInfoModule(OneViewModuleBase):
def __init__(self):
super(EnclosureInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
self.is_old_facts = self.module._name == 'oneview_enclosure_facts'
self.is_old_facts = self.module._name in ('oneview_enclosure_facts', 'community.general.oneview_enclosure_facts')
if self.is_old_facts:
self.module.deprecate("The 'oneview_enclosure_facts' module has been renamed to 'oneview_enclosure_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')

View file

@ -116,7 +116,7 @@ class EthernetNetworkInfoModule(OneViewModuleBase):
def __init__(self):
super(EthernetNetworkInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
self.is_old_facts = self.module._name == 'oneview_ethernet_network_facts'
self.is_old_facts = self.module._name in ('oneview_ethernet_network_facts', 'community.general.oneview_ethernet_network_facts')
if self.is_old_facts:
self.module.deprecate("The 'oneview_ethernet_network_facts' module has been renamed to 'oneview_ethernet_network_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')

View file

@ -87,7 +87,7 @@ class FcNetworkInfoModule(OneViewModuleBase):
)
super(FcNetworkInfoModule, self).__init__(additional_arg_spec=argument_spec)
self.is_old_facts = self.module._name == 'oneview_fc_network_facts'
self.is_old_facts = self.module._name in ('oneview_fc_network_facts', 'community.general.oneview_fc_network_facts')
if self.is_old_facts:
self.module.deprecate("The 'oneview_fc_network_facts' module has been renamed to 'oneview_fc_network_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')

View file

@ -86,7 +86,7 @@ class FcoeNetworkInfoModule(OneViewModuleBase):
)
super(FcoeNetworkInfoModule, self).__init__(additional_arg_spec=argument_spec)
self.is_old_facts = self.module._name == 'oneview_fcoe_network_facts'
self.is_old_facts = self.module._name in ('oneview_fcoe_network_facts', 'community.general.oneview_fcoe_network_facts')
if self.is_old_facts:
self.module.deprecate("The 'oneview_fcoe_network_facts' module has been renamed to 'oneview_fcoe_network_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')

View file

@ -100,7 +100,7 @@ class LogicalInterconnectGroupInfoModule(OneViewModuleBase):
)
super(LogicalInterconnectGroupInfoModule, self).__init__(additional_arg_spec=argument_spec)
self.is_old_facts = self.module._name == 'oneview_logical_interconnect_group_facts'
self.is_old_facts = self.module._name in ('oneview_logical_interconnect_group_facts', 'community.general.oneview_logical_interconnect_group_facts')
if self.is_old_facts:
self.module.deprecate("The 'oneview_logical_interconnect_group_facts' module has been renamed to 'oneview_logical_interconnect_group_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')

View file

@ -137,7 +137,7 @@ class NetworkSetInfoModule(OneViewModuleBase):
def __init__(self):
super(NetworkSetInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
self.is_old_facts = self.module._name == 'oneview_network_set_facts'
self.is_old_facts = self.module._name in ('oneview_network_set_facts', 'community.general.oneview_network_set_facts')
if self.is_old_facts:
self.module.deprecate("The 'oneview_network_set_facts' module has been renamed to 'oneview_network_set_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')

View file

@ -94,7 +94,7 @@ class SanManagerInfoModule(OneViewModuleBase):
def __init__(self):
super(SanManagerInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
self.resource_client = self.oneview_client.san_managers
self.is_old_facts = self.module._name == 'oneview_san_manager_facts'
self.is_old_facts = self.module._name in ('oneview_san_manager_facts', 'community.general.oneview_san_manager_facts')
if self.is_old_facts:
self.module.deprecate("The 'oneview_san_manager_facts' module has been renamed to 'oneview_san_manager_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')

View file

@ -183,7 +183,7 @@ def main():
),
supports_check_mode=False
)
is_old_facts = module._name == 'idrac_redfish_facts'
is_old_facts = module._name in ('idrac_redfish_facts', 'community.general.idrac_redfish_facts')
if is_old_facts:
module.deprecate("The 'idrac_redfish_facts' module has been renamed to 'idrac_redfish_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')

View file

@ -309,7 +309,7 @@ def main():
),
supports_check_mode=False
)
is_old_facts = module._name == 'redfish_facts'
is_old_facts = module._name in ('redfish_facts', 'community.general.redfish_facts')
if is_old_facts:
module.deprecate("The 'redfish_facts' module has been renamed to 'redfish_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')