mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
Fix stray string in network_cli (#51142)
* Replace loose string that should be a byte string * Replace byte string literals with string literals * These, on the other hand, need to be byte strings
This commit is contained in:
parent
335ee5908d
commit
8d4f7f5b56
17 changed files with 61 additions and 61 deletions
|
@ -35,21 +35,21 @@ class Cliconf(CliconfBase):
|
|||
device_info = {}
|
||||
|
||||
device_info['network_os'] = 'slxos'
|
||||
reply = self.get(b'show version')
|
||||
reply = self.get('show version')
|
||||
data = to_text(reply, errors='surrogate_or_strict').strip()
|
||||
|
||||
match = re.search(r'SLX\-OS Operating System Version: (\S+)', data)
|
||||
if match:
|
||||
device_info['network_os_version'] = match.group(1)
|
||||
|
||||
reply = self.get(b'show chassis')
|
||||
reply = self.get('show chassis')
|
||||
data = to_text(reply, errors='surrogate_or_strict').strip()
|
||||
|
||||
match = re.search(r'^Chassis Name:(\s+)(\S+)', data, re.M)
|
||||
if match:
|
||||
device_info['network_os_model'] = match.group(2)
|
||||
|
||||
reply = self.get(b'show running-config | inc "switch-attributes host-name"')
|
||||
reply = self.get('show running-config | inc "switch-attributes host-name"')
|
||||
data = to_text(reply, errors='surrogate_or_strict').strip()
|
||||
|
||||
match = re.search(r'switch-attributes host-name (\S+)', data, re.M)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue