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:
Maugli 2018-09-14 19:21:30 +02:00 committed by Nilashish Chakraborty
commit 235b11f681
2 changed files with 4 additions and 4 deletions

View file

@ -135,7 +135,7 @@ class Default(FactsBase):
self.facts['hostname'] = self.responses[1]
def parse_version(self, data):
match = re.search(r'Version:\s*(\S+)', data)
match = re.search(r'Version:\s*(.*)', data)
if match:
return match.group(1)