mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ios cliconf plugin fix regex for version (#40066)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
0407c51447
commit
5cf61d7401
1 changed files with 2 additions and 2 deletions
|
@ -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:
|
||||||
|
|
Loading…
Add table
Reference in a new issue