diff --git a/changelogs/fragments/384-warnings.yml b/changelogs/fragments/384-warnings.yml new file mode 100644 index 0000000..77eaef9 --- /dev/null +++ b/changelogs/fragments/384-warnings.yml @@ -0,0 +1,2 @@ +bugfixes: + - "facts and api_facts modules - prevent deprecation warnings when used with ansible-core 2.19 (https://github.com/ansible-collections/community.routeros/pull/384)." diff --git a/plugins/modules/api_facts.py b/plugins/modules/api_facts.py index 41c9a4e..09c0fbb 100644 --- a/plugins/modules/api_facts.py +++ b/plugins/modules/api_facts.py @@ -419,8 +419,6 @@ FACT_SUBSETS = dict( VALID_SUBSETS = frozenset(FACT_SUBSETS.keys()) -warnings = [] - def main(): argument_spec = dict( @@ -485,7 +483,7 @@ def main(): key = 'ansible_net_%s' % key ansible_facts[key] = value - module.exit_json(ansible_facts=ansible_facts, warnings=warnings) + module.exit_json(ansible_facts=ansible_facts) if __name__ == '__main__': diff --git a/plugins/modules/facts.py b/plugins/modules/facts.py index e75d609..e80143c 100644 --- a/plugins/modules/facts.py +++ b/plugins/modules/facts.py @@ -589,8 +589,6 @@ FACT_SUBSETS = dict( VALID_SUBSETS = frozenset(FACT_SUBSETS.keys()) -warnings = list() - def main(): """main entry point for module execution @@ -653,7 +651,7 @@ def main(): key = 'ansible_net_%s' % key ansible_facts[key] = value - module.exit_json(ansible_facts=ansible_facts, warnings=warnings) + module.exit_json(ansible_facts=ansible_facts) if __name__ == '__main__':