diff --git a/napalm_sros/sros.py b/napalm_sros/sros.py index 5a3df56..1dcd029 100644 --- a/napalm_sros/sros.py +++ b/napalm_sros/sros.py @@ -1105,6 +1105,7 @@ def get_config( retrieve="all", full=False, sanitized=False, + format="text", ): """ Return the configuration of a device. @@ -1128,7 +1129,7 @@ def get_config( """ try: configuration = {"running": "", "candidate": "", "startup": ""} - if self.sros_get_format == "cli" and (sanitized is True or sanitized is False): + if self.sros_get_format == "cli" or format == "cli": # Getting output in MD-CLI format # retrieving config using md-cli cmd_running = "admin show configuration | no-more" @@ -1190,7 +1191,7 @@ def _update_buff(buff): return configuration # returning the config in xml format - elif self.sros_get_format == "xml" and (sanitized is True or sanitized is False): + elif self.sros_get_format == "xml" or format == "xml": config_data_running_xml = "" if retrieve == "running" or retrieve == "all": config_data_running = to_ele( diff --git a/test/unit/conftest.py b/test/unit/conftest.py index ecc55e6..e74b07e 100644 --- a/test/unit/conftest.py +++ b/test/unit/conftest.py @@ -60,6 +60,7 @@ class FakeNokiaSROSDevice(BaseTestDouble): def __init__(self): self.get = FakeGetMethod(self) self.get_config = FakeGetConfigMethod(self) + self.server_capabilities = [] def open(self): pass