From 0ada6b8d8d070f8f1eb36cd82a1e4198a53e0b58 Mon Sep 17 00:00:00 2001 From: Daniel Mellado Area Date: Wed, 29 May 2019 02:25:46 +0200 Subject: [PATCH] Fix junos_facts test (#57065) This commit fixes a non-passing junos_facts integration test, as it was using a non-ordered frozenset to assert its result. --- lib/ansible/modules/network/junos/junos_facts.py | 3 ++- test/integration/targets/junos_facts/tests/netconf/facts.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/network/junos/junos_facts.py b/lib/ansible/modules/network/junos/junos_facts.py index d899f97c86..161176639b 100644 --- a/lib/ansible/modules/network/junos/junos_facts.py +++ b/lib/ansible/modules/network/junos/junos_facts.py @@ -354,7 +354,8 @@ def main(): if subset not in VALID_SUBSETS: module.fail_json(msg='Subset must be one of [%s], got %s' % - (', '.join(VALID_SUBSETS), subset)) + (', '.join(sorted([subset for subset in + VALID_SUBSETS])), subset)) if exclude: exclude_subsets.add(subset) diff --git a/test/integration/targets/junos_facts/tests/netconf/facts.yaml b/test/integration/targets/junos_facts/tests/netconf/facts.yaml index 092283af1c..c22a7a039d 100644 --- a/test/integration/targets/junos_facts/tests/netconf/facts.yaml +++ b/test/integration/targets/junos_facts/tests/netconf/facts.yaml @@ -50,7 +50,7 @@ - assert: that: - "result.failed == true" - - "result.msg == 'Subset must be one of [hardware, default, ofacts, config, interfaces], got test'" + - "result.msg == 'Subset must be one of [config, default, hardware, interfaces, ofacts], got test'" - name: Collect config facts from device in set format junos_facts: