diff options
Diffstat (limited to 'ansible_collections/cisco/iosxr/plugins/cliconf/iosxr.py')
-rw-r--r-- | ansible_collections/cisco/iosxr/plugins/cliconf/iosxr.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/ansible_collections/cisco/iosxr/plugins/cliconf/iosxr.py b/ansible_collections/cisco/iosxr/plugins/cliconf/iosxr.py index 706bff6e5..6b569ae2a 100644 --- a/ansible_collections/cisco/iosxr/plugins/cliconf/iosxr.py +++ b/ansible_collections/cisco/iosxr/plugins/cliconf/iosxr.py @@ -248,6 +248,17 @@ class Cliconf(CliconfBase): device_info["network_os_model"] = match.group(1) break + if "network_os_model" not in device_info: + data = self.get_command_output("show inventory") + match = re.search(r"DESCR: \"[Cc]isco (\S+ \S+)", data, re.M) + if match: + device_info["network_os_model"] = match.group(1) + + data = self.get_command_output("show inventory") + match = re.search(r"SN: (\S+)\n\nNAME:", data, re.M) + if match: + device_info["network_os_serialnum"] = match.group(1) + hostname = self.get_command_output("show running-config hostname") match = re.search(r"hostname\s(\S+)$", hostname, re.M) if match: @@ -274,7 +285,7 @@ class Cliconf(CliconfBase): if admin and "admin-" in prompt: self.send_command("exit") - def get_config(self, source="running", format="text", flags=None): + def get_config(self, source="running", flags=None, format="text"): if source not in ["running"]: raise ValueError("fetching configuration from %s is not supported" % source) @@ -290,10 +301,11 @@ class Cliconf(CliconfBase): self, candidate=None, commit=True, - admin=False, - exclusive=False, replace=None, + diff=False, comment=None, + admin=False, + exclusive=False, label=None, ): operations = self.get_device_operations() |