net_facts modules: Don't warn about defaults changing if they're not being used (#66270)
This commit is contained in:
parent
223e1675f4
commit
3a2257c45c
7 changed files with 38 additions and 20 deletions
2
changelogs/fragments/66270-net-facts-quieter.yaml
Normal file
2
changelogs/fragments/66270-net-facts-quieter.yaml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- Do not emit warnings about changing network facts defaults when not using the defaults.
|
|
@ -181,7 +181,8 @@ from ansible.module_utils.network.eos.eos import eos_argument_spec
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
""" Main entry point for module execution
|
"""
|
||||||
|
Main entry point for module execution
|
||||||
|
|
||||||
:returns: ansible_facts
|
:returns: ansible_facts
|
||||||
"""
|
"""
|
||||||
|
@ -191,8 +192,9 @@ def main():
|
||||||
module = AnsibleModule(argument_spec=argument_spec,
|
module = AnsibleModule(argument_spec=argument_spec,
|
||||||
supports_check_mode=True)
|
supports_check_mode=True)
|
||||||
|
|
||||||
warnings = ['default value for `gather_subset` '
|
warnings = []
|
||||||
'will be changed to `min` from `!config` v2.11 onwards']
|
if module.params["gather_subset"] == "!config":
|
||||||
|
warnings.append('default value for `gather_subset` will be changed to `min` from `!config` v2.11 onwards')
|
||||||
|
|
||||||
result = Facts(module).get_facts()
|
result = Facts(module).get_facts()
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,10 @@ from ansible.module_utils.network.ios.ios import ios_argument_spec
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
""" Main entry point for AnsibleModule
|
"""
|
||||||
|
Main entry point for module execution
|
||||||
|
|
||||||
|
:returns: ansible_facts
|
||||||
"""
|
"""
|
||||||
argument_spec = FactsArgs.argument_spec
|
argument_spec = FactsArgs.argument_spec
|
||||||
argument_spec.update(ios_argument_spec)
|
argument_spec.update(ios_argument_spec)
|
||||||
|
@ -220,8 +223,9 @@ def main():
|
||||||
module = AnsibleModule(argument_spec=argument_spec,
|
module = AnsibleModule(argument_spec=argument_spec,
|
||||||
supports_check_mode=True)
|
supports_check_mode=True)
|
||||||
|
|
||||||
warnings = ['default value for `gather_subset` '
|
warnings = []
|
||||||
'will be changed to `min` from `!config` v2.11 onwards']
|
if module.params["gather_subset"] == "!config":
|
||||||
|
warnings.append('default value for `gather_subset` will be changed to `min` from `!config` v2.11 onwards')
|
||||||
|
|
||||||
result = Facts(module).get_facts()
|
result = Facts(module).get_facts()
|
||||||
|
|
||||||
|
|
|
@ -193,13 +193,15 @@ def main():
|
||||||
|
|
||||||
:returns: ansible_facts
|
:returns: ansible_facts
|
||||||
"""
|
"""
|
||||||
spec = FactsArgs.argument_spec
|
argument_spec = FactsArgs.argument_spec
|
||||||
spec.update(iosxr_argument_spec)
|
argument_spec.update(iosxr_argument_spec)
|
||||||
|
|
||||||
module = AnsibleModule(argument_spec=spec,
|
module = AnsibleModule(argument_spec=argument_spec,
|
||||||
supports_check_mode=True)
|
supports_check_mode=True)
|
||||||
warnings = ['default value for `gather_subset` '
|
|
||||||
'will be changed to `min` from `!config` v2.11 onwards']
|
warnings = []
|
||||||
|
if module.params["gather_subset"] == "!config":
|
||||||
|
warnings.append('default value for `gather_subset` will be changed to `min` from `!config` v2.11 onwards')
|
||||||
|
|
||||||
result = Facts(module).get_facts()
|
result = Facts(module).get_facts()
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,10 @@ from ansible.module_utils.network.junos.junos import junos_argument_spec
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
""" Main entry point for AnsibleModule
|
"""
|
||||||
|
Main entry point for module execution
|
||||||
|
|
||||||
|
:returns: ansible_facts
|
||||||
"""
|
"""
|
||||||
argument_spec = FactsArgs.argument_spec
|
argument_spec = FactsArgs.argument_spec
|
||||||
argument_spec.update(junos_argument_spec)
|
argument_spec.update(junos_argument_spec)
|
||||||
|
@ -120,8 +123,9 @@ def main():
|
||||||
module = AnsibleModule(argument_spec=argument_spec,
|
module = AnsibleModule(argument_spec=argument_spec,
|
||||||
supports_check_mode=True)
|
supports_check_mode=True)
|
||||||
|
|
||||||
warnings = ['default value for `gather_subset` '
|
warnings = []
|
||||||
'will be changed to `min` from `!config` v2.11 onwards']
|
if module.params["gather_subset"] == "!config":
|
||||||
|
warnings.append('default value for `gather_subset` will be changed to `min` from `!config` v2.11 onwards')
|
||||||
|
|
||||||
result = Facts(module).get_facts()
|
result = Facts(module).get_facts()
|
||||||
|
|
||||||
|
|
|
@ -216,7 +216,10 @@ from ansible.module_utils.network.nxos.nxos import nxos_argument_spec
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
""" Main entry point for AnsibleModule
|
"""
|
||||||
|
Main entry point for module execution
|
||||||
|
|
||||||
|
:returns: ansible_facts
|
||||||
"""
|
"""
|
||||||
argument_spec = FactsArgs.argument_spec
|
argument_spec = FactsArgs.argument_spec
|
||||||
argument_spec.update(nxos_argument_spec)
|
argument_spec.update(nxos_argument_spec)
|
||||||
|
@ -224,8 +227,9 @@ def main():
|
||||||
module = AnsibleModule(argument_spec=argument_spec,
|
module = AnsibleModule(argument_spec=argument_spec,
|
||||||
supports_check_mode=True)
|
supports_check_mode=True)
|
||||||
|
|
||||||
warnings = ['default value for `gather_subset` '
|
warnings = []
|
||||||
'will be changed to `min` from `!config` v2.11 onwards']
|
if module.params["gather_subset"] == "!config":
|
||||||
|
warnings.append('default value for `gather_subset` will be changed to `min` from `!config` v2.11 onwards')
|
||||||
|
|
||||||
result = Facts(module).get_facts()
|
result = Facts(module).get_facts()
|
||||||
|
|
||||||
|
|
|
@ -150,14 +150,14 @@ def main():
|
||||||
:returns: ansible_facts
|
:returns: ansible_facts
|
||||||
"""
|
"""
|
||||||
argument_spec = FactsArgs.argument_spec
|
argument_spec = FactsArgs.argument_spec
|
||||||
|
|
||||||
argument_spec.update(vyos_argument_spec)
|
argument_spec.update(vyos_argument_spec)
|
||||||
|
|
||||||
module = AnsibleModule(argument_spec=argument_spec,
|
module = AnsibleModule(argument_spec=argument_spec,
|
||||||
supports_check_mode=True)
|
supports_check_mode=True)
|
||||||
|
|
||||||
warnings = ['default value for `gather_subset` '
|
warnings = []
|
||||||
'will be changed to `min` from `!config` v2.11 onwards']
|
if module.params["gather_subset"] == "!config":
|
||||||
|
warnings.append('default value for `gather_subset` will be changed to `min` from `!config` v2.11 onwards')
|
||||||
|
|
||||||
result = Facts(module).get_facts()
|
result = Facts(module).get_facts()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue