mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Return correct version on installed VyOS (#39115)
* Return correct version on installed VyOS Previously existing regexp will shows only "VyOS" without numeric output of router version. For example: from "Version: VyOS 1.1.6" only VyOS will be written in ansible_net_version variable For more informative output numeric value should be returned as well * Fixed unittests
This commit is contained in:
committed by
Nilashish Chakraborty
parent
829f48e3f5
commit
235b11f681
@@ -63,7 +63,7 @@ class TestVyosFactsModule(TestVyosModule):
|
||||
facts = result.get('ansible_facts')
|
||||
self.assertEqual(len(facts), 5)
|
||||
self.assertEqual(facts['ansible_net_hostname'].strip(), 'vyos01')
|
||||
self.assertEqual(facts['ansible_net_version'], 'VyOS')
|
||||
self.assertEqual(facts['ansible_net_version'], 'VyOS 1.1.7')
|
||||
|
||||
def test_vyos_facts_not_all(self):
|
||||
set_module_args(dict(gather_subset='!all'))
|
||||
@@ -71,7 +71,7 @@ class TestVyosFactsModule(TestVyosModule):
|
||||
facts = result.get('ansible_facts')
|
||||
self.assertEqual(len(facts), 5)
|
||||
self.assertEqual(facts['ansible_net_hostname'].strip(), 'vyos01')
|
||||
self.assertEqual(facts['ansible_net_version'], 'VyOS')
|
||||
self.assertEqual(facts['ansible_net_version'], 'VyOS 1.1.7')
|
||||
|
||||
def test_vyos_facts_exclude_most(self):
|
||||
set_module_args(dict(gather_subset=['!neighbors', '!config']))
|
||||
@@ -79,7 +79,7 @@ class TestVyosFactsModule(TestVyosModule):
|
||||
facts = result.get('ansible_facts')
|
||||
self.assertEqual(len(facts), 5)
|
||||
self.assertEqual(facts['ansible_net_hostname'].strip(), 'vyos01')
|
||||
self.assertEqual(facts['ansible_net_version'], 'VyOS')
|
||||
self.assertEqual(facts['ansible_net_version'], 'VyOS 1.1.7')
|
||||
|
||||
def test_vyos_facts_invalid_subset(self):
|
||||
set_module_args(dict(gather_subset='cereal'))
|
||||
|
||||
Reference in New Issue
Block a user