Skip to content

Commit 135af20

Browse files
authored
Merge pull request #30 from miaow2/develop
Version 1.2.2
2 parents ba5a20e + 546bff3 commit 135af20

File tree

9 files changed

+87
-10
lines changed

9 files changed

+87
-10
lines changed

.github/workflows/commit.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ jobs:
2929
test:
3030
runs-on: ubuntu-latest
3131
strategy:
32+
max-parallel: 10
3233
matrix:
33-
netbox_version: ["v3.5.8"]
34+
netbox_version: ["v3.5.9", "v3.6.1"]
3435
steps:
3536
- name: Checkout
3637
uses: actions/checkout@v3

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![NetBox version](https://img.shields.io/badge/NetBox-3.5-blue.svg)](https://github.com/netbox-community/netbox)
1+
[![NetBox version](https://img.shields.io/badge/NetBox-3.5|3.6-blue.svg)](https://github.com/netbox-community/netbox)
22
[![Supported Versions](https://img.shields.io/pypi/pyversions/netbox-config-diff.svg)](https://pypi.org/project/netbox-config-diff/)
33
[![PyPI version](https://badge.fury.io/py/netbox-config-diff.svg)](https://badge.fury.io/py/netbox-config-diff)
44
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
@@ -29,7 +29,7 @@ Plugin supports a wide list of vendors (Cisco, Juniper, Huawei, MicroTik etc.) w
2929

3030
| NetBox Version | Plugin Version |
3131
|----------------|----------------|
32-
| 3.5 | =>0.1.0 |
32+
| 3.5, 3.6 | =>0.1.0 |
3333

3434
<!--install-start-->
3535
## Installing

docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.2.2 (2023-09-29)
4+
5+
* [#28](https://github.com/miaow2/netbox-config-diff/issues/28) Add legacy ssh algorithms to support old OS versions
6+
37
## 1.2.1 (2023-09-07)
48

59
* [#26](https://github.com/miaow2/netbox-config-diff/issues/26) Add dark theme for diff

netbox_config_diff/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
__author__ = "Artem Kotik"
44
__email__ = "miaow2@yandex.ru"
5-
__version__ = "1.2.1"
5+
__version__ = "1.2.2"
66

77

88
class ConfigDiffConfig(PluginConfig):

netbox_config_diff/compliance/models.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,42 @@ def to_scrapli(self):
3636
"platform": self.platform,
3737
"auth_strict_key": self.auth_strict_key,
3838
"transport": self.transport,
39+
"transport_options": {
40+
"asyncssh": {
41+
"kex_algs": [
42+
"curve25519-sha256",
43+
"curve25519-sha256@libssh.org",
44+
"curve448-sha512",
45+
"ecdh-sha2-nistp521",
46+
"ecdh-sha2-nistp384",
47+
"ecdh-sha2-nistp256",
48+
"ecdh-sha2-1.3.132.0.10",
49+
"diffie-hellman-group-exchange-sha256",
50+
"diffie-hellman-group14-sha256",
51+
"diffie-hellman-group15-sha512",
52+
"diffie-hellman-group16-sha512",
53+
"diffie-hellman-group17-sha512",
54+
"diffie-hellman-group18-sha512",
55+
"diffie-hellman-group14-sha256@ssh.com",
56+
"diffie-hellman-group14-sha1",
57+
"rsa2048-sha256",
58+
"diffie-hellman-group1-sha1",
59+
"diffie-hellman-group-exchange-sha1",
60+
"diffie-hellman-group-exchange-sha256",
61+
],
62+
"encryption_algs": [
63+
"aes256-cbc",
64+
"aes192-cbc",
65+
"aes128-cbc",
66+
"3des-cbc",
67+
"aes256-ctr",
68+
"aes192-ctr",
69+
"aes128-ctr",
70+
"aes128-gcm@openssh.com",
71+
"chacha20-poly1305@openssh.com",
72+
],
73+
},
74+
},
3975
}
4076

4177
def to_db(self):

netbox_config_diff/compliance/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
def get_unified_diff(rendered_config: str, actual_config: str, device: str) -> str:
2121
diff = unified_diff(
22-
rendered_config.splitlines(),
22+
rendered_config.strip().splitlines(),
2323
actual_config.splitlines(),
2424
fromfiledate=device,
2525
tofiledate=device,
@@ -31,4 +31,4 @@ def get_unified_diff(rendered_config: str, actual_config: str, device: str) -> s
3131
def exclude_lines(text: str, regex: str) -> str:
3232
for item in regex.splitlines():
3333
text = re.sub(item, "", text, flags=re.MULTILINE)
34-
return text
34+
return text.strip()

netbox_config_diff/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class PlatformSetting(NetBoxModel):
8383
)
8484
exclude_regex = models.TextField(
8585
blank=True,
86-
help_text=_("Regex patterns to exclude from actual config, specify each pattern on a new line."),
86+
help_text=_("Regex patterns to exclude config lines from actual config, specify each pattern on a new line."),
8787
)
8888

8989
prerequisite_models = ("dcim.Platform",)

tests/test_compliance.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,42 @@ def test_devicedataclass_to_scrapli(devicedataclass_data: "DeviceDataClassData")
9090
"platform": devicedataclass_data.platform,
9191
"auth_strict_key": devicedataclass_data.auth_strict_key,
9292
"transport": devicedataclass_data.transport,
93+
"transport_options": {
94+
"asyncssh": {
95+
"kex_algs": [
96+
"curve25519-sha256",
97+
"curve25519-sha256@libssh.org",
98+
"curve448-sha512",
99+
"ecdh-sha2-nistp521",
100+
"ecdh-sha2-nistp384",
101+
"ecdh-sha2-nistp256",
102+
"ecdh-sha2-1.3.132.0.10",
103+
"diffie-hellman-group-exchange-sha256",
104+
"diffie-hellman-group14-sha256",
105+
"diffie-hellman-group15-sha512",
106+
"diffie-hellman-group16-sha512",
107+
"diffie-hellman-group17-sha512",
108+
"diffie-hellman-group18-sha512",
109+
"diffie-hellman-group14-sha256@ssh.com",
110+
"diffie-hellman-group14-sha1",
111+
"rsa2048-sha256",
112+
"diffie-hellman-group1-sha1",
113+
"diffie-hellman-group-exchange-sha1",
114+
"diffie-hellman-group-exchange-sha256",
115+
],
116+
"encryption_algs": [
117+
"aes256-cbc",
118+
"aes192-cbc",
119+
"aes128-cbc",
120+
"3des-cbc",
121+
"aes256-ctr",
122+
"aes192-ctr",
123+
"aes128-ctr",
124+
"aes128-gcm@openssh.com",
125+
"chacha20-poly1305@openssh.com",
126+
],
127+
},
128+
},
93129
}
94130

95131

tests/test_compliance_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
[
2323
(
2424
"^interface.?\n^Building",
25-
"hostname test-1\n\nfa-0/0\n switchport mode access\n switchport access vlan 100\n",
25+
"hostname test-1\n\nfa-0/0\n switchport mode access\n switchport access vlan 100",
2626
),
2727
(
2828
"^interface.*$\n^Building",
29-
"hostname test-1\n\n\n switchport mode access\n switchport access vlan 100\n",
29+
"hostname test-1\n\n\n switchport mode access\n switchport access vlan 100",
3030
),
3131
(
3232
"^Building",
33-
"hostname test-1\n\ninterface fa-0/0\n switchport mode access\n switchport access vlan 100\n",
33+
"hostname test-1\n\ninterface fa-0/0\n switchport mode access\n switchport access vlan 100",
3434
),
3535
],
3636
ids=["part of line", "full line", "no effect"],

0 commit comments

Comments
 (0)