diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index 4c8eb9f82..9c52b456c 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -2459,12 +2459,17 @@ def get_config(self, retrieve="all", full=False, sanitized=False, format="text") } if retrieve in ("candidate", "all"): config = self.device.rpc.get_config(filter_xml=None, options=options) - rv["candidate"] = str(config.text) + if options["format"] == "text": + rv["candidate"] = str(config.text) + else: + return str(config["configuration"]) if retrieve in ("running", "all"): options["database"] = "committed" config = self.device.rpc.get_config(filter_xml=None, options=options) - rv["running"] = str(config.text) - + if options["format"] == "text": + rv["candidate"] = str(config.text) + else: + return str(config["configuration"]) if sanitized: return napalm.base.helpers.sanitize_configs(rv, sanitize_strings)