Skip to content

Commit

Permalink
Merge pull request #1414 from minefuto/fix_sinitized_junos
Browse files Browse the repository at this point in the history
Fix sinitized bug for Junos
  • Loading branch information
mirceaulinic authored Mar 29, 2021
2 parents 9f3f552 + b48f440 commit 5977b14
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion napalm/junos/junos.py
Original file line number Diff line number Diff line change
Expand Up @@ -2369,7 +2369,7 @@ def get_config(self, retrieve="all", full=False, sanitized=False):

options = {"format": "text", "database": "candidate"}
sanitize_strings = {
r"^(\s+community\s+)\w+(\s+{.*)$": r"\1<removed>\2",
r"^(\s+community\s+)\w+(;.*|\s+{.*)$": r"\1<removed>\2",
r'^(.*)"\$\d\$\S+"(;.*)$': r"\1<removed>\2",
}
if retrieve in ("candidate", "all"):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"startup": "",
"running": "\nversion 18.1;\nsystem {\n host-name some-switch;\n domain-name example.com;\n time-zone UTC;\n authentication-order [ password radius ];\n root-authentication {\n encrypted-password <removed>;\n }\n radius-server {\n 10.0.0.1 {\n secret <removed>;\n timeout 3;\n retry 1;\n }\n }\n login {\n user test-user {\n uid 1717;\n class admin;\n authentication {\n encrypted-password <removed>;\n }\n }\n }\n }\n services {\n ssh {\n protocol-version v2;\n }\n netconf {\n ssh;\n }\n }\n ntp {\n server 10.17.0.1;\n }\n}\nsnmp {\n location napalm;\n contact \"contact@napalm-automation.net\";\n community <removed> {\n authorization read-only;\n }\n}\n",
"candidate": "\nversion 18.1;\nsystem {\n host-name some-switch;\n domain-name example.com;\n time-zone UTC;\n authentication-order [ password radius ];\n root-authentication {\n encrypted-password <removed>;\n }\n radius-server {\n 10.0.0.1 {\n secret <removed>;\n timeout 3;\n retry 1;\n }\n }\n login {\n user test-user {\n uid 1717;\n class admin;\n authentication {\n encrypted-password <removed>;\n }\n }\n }\n }\n services {\n ssh {\n protocol-version v2;\n }\n netconf {\n ssh;\n }\n }\n ntp {\n server 10.17.0.1;\n }\n}\nsnmp {\n location napalm;\n contact \"contact@napalm-automation.net\";\n community <removed> {\n authorization read-only;\n }\n}\n"
"running": "\nversion 18.1;\nsystem {\n host-name some-switch;\n domain-name example.com;\n time-zone UTC;\n authentication-order [ password radius ];\n root-authentication {\n encrypted-password <removed>;\n }\n radius-server {\n 10.0.0.1 {\n secret <removed>;\n timeout 3;\n retry 1;\n }\n }\n login {\n user test-user {\n uid 1717;\n class admin;\n authentication {\n encrypted-password <removed>;\n }\n }\n }\n }\n services {\n ssh {\n protocol-version v2;\n }\n netconf {\n ssh;\n }\n }\n ntp {\n server 10.17.0.1;\n }\n}\nsnmp {\n location napalm;\n contact \"contact@napalm-automation.net\";\n community <removed>;\n community <removed> {\n authorization read-only;\n }\n}\n",
"candidate": "\nversion 18.1;\nsystem {\n host-name some-switch;\n domain-name example.com;\n time-zone UTC;\n authentication-order [ password radius ];\n root-authentication {\n encrypted-password <removed>;\n }\n radius-server {\n 10.0.0.1 {\n secret <removed>;\n timeout 3;\n retry 1;\n }\n }\n login {\n user test-user {\n uid 1717;\n class admin;\n authentication {\n encrypted-password <removed>;\n }\n }\n }\n }\n services {\n ssh {\n protocol-version v2;\n }\n netconf {\n ssh;\n }\n }\n ntp {\n server 10.17.0.1;\n }\n}\nsnmp {\n location napalm;\n contact \"contact@napalm-automation.net\";\n community <removed>;\n community <removed> {\n authorization read-only;\n }\n}\n"
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ system {
snmp {
location napalm;
contact "contact@napalm-automation.net";
community public;
community secure {
authorization read-only;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ system {
snmp {
location napalm;
contact "contact@napalm-automation.net";
community public;
community secure {
authorization read-only;
}
Expand Down

0 comments on commit 5977b14

Please sign in to comment.