mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
ios cliconf plugin fix regex for version (#40066)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
@@ -38,9 +38,9 @@ class Cliconf(CliconfBase):
|
|||||||
reply = self.get('show version')
|
reply = self.get('show version')
|
||||||
data = to_text(reply, errors='surrogate_or_strict').strip()
|
data = to_text(reply, errors='surrogate_or_strict').strip()
|
||||||
|
|
||||||
match = re.search(r'Version (\S+),', data)
|
match = re.search(r'Version (\S+)', data)
|
||||||
if match:
|
if match:
|
||||||
device_info['network_os_version'] = match.group(1)
|
device_info['network_os_version'] = match.group(1).strip(',')
|
||||||
|
|
||||||
match = re.search(r'^Cisco (.+) \(revision', data, re.M)
|
match = re.search(r'^Cisco (.+) \(revision', data, re.M)
|
||||||
if match:
|
if match:
|
||||||
|
|||||||
Reference in New Issue
Block a user