annet 1.0.1__py3-none-any.whl → 1.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of annet might be problematic. Click here for more details.
- annet/adapters/netbox/common/manufacturer.py +1 -1
- annet/adapters/netbox/common/models.py +2 -1
- annet/adapters/netbox/common/query.py +2 -1
- annet/adapters/netbox/v37/storage.py +2 -0
- annet/annlib/netdev/devdb/data/devdb.json +3 -1
- annet/bgp_models.py +5 -2
- annet/rpl_generators/prefix_lists.py +14 -15
- annet/rulebook/texts/arista.order +1 -0
- {annet-1.0.1.dist-info → annet-1.0.2.dist-info}/METADATA +2 -2
- {annet-1.0.1.dist-info → annet-1.0.2.dist-info}/RECORD +15 -15
- {annet-1.0.1.dist-info → annet-1.0.2.dist-info}/AUTHORS +0 -0
- {annet-1.0.1.dist-info → annet-1.0.2.dist-info}/LICENSE +0 -0
- {annet-1.0.1.dist-info → annet-1.0.2.dist-info}/WHEEL +0 -0
- {annet-1.0.1.dist-info → annet-1.0.2.dist-info}/entry_points.txt +0 -0
- {annet-1.0.1.dist-info → annet-1.0.2.dist-info}/top_level.txt +0 -0
|
@@ -54,7 +54,7 @@ def get_breed(manufacturer: str, model: str):
|
|
|
54
54
|
return "bcom-os"
|
|
55
55
|
elif manufacturer == "MikroTik":
|
|
56
56
|
return "routeros"
|
|
57
|
-
elif manufacturer
|
|
57
|
+
elif manufacturer in ("Moxa", "Nebius"):
|
|
58
58
|
return "moxa"
|
|
59
59
|
elif manufacturer == "PC":
|
|
60
60
|
return "pc"
|
|
@@ -214,7 +214,8 @@ class NetboxDevice(Entity):
|
|
|
214
214
|
return type(self) is type(other) and self.url == other.url
|
|
215
215
|
|
|
216
216
|
def is_pc(self) -> bool:
|
|
217
|
-
|
|
217
|
+
custom_breed_pc = ("Mellanox", "NVIDIA", "Moxa", "Nebius")
|
|
218
|
+
return self.device_type.manufacturer.name in custom_breed_pc or self.breed == "pc"
|
|
218
219
|
|
|
219
220
|
def _make_interface(self, name: str, type: InterfaceType) -> Interface:
|
|
220
221
|
return Interface(
|
|
@@ -5,7 +5,7 @@ from typing import cast, List, Union, Iterable, Optional, TypedDict
|
|
|
5
5
|
from annet.storage import Query
|
|
6
6
|
|
|
7
7
|
FIELD_VALUE_SEPARATOR = ":"
|
|
8
|
-
ALLOWED_GLOB_GROUPS = ["site", "tag", "role"]
|
|
8
|
+
ALLOWED_GLOB_GROUPS = ["site", "tag", "role", "device_type"]
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class Filter(TypedDict, total=False):
|
|
@@ -13,6 +13,7 @@ class Filter(TypedDict, total=False):
|
|
|
13
13
|
tag: list[str]
|
|
14
14
|
role: list[str]
|
|
15
15
|
name: list[str]
|
|
16
|
+
device_type: list[str]
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
@dataclass
|
|
@@ -312,8 +312,10 @@ def _match_query(exact_host_filter: bool, query: NetboxQuery, device_data: api_m
|
|
|
312
312
|
hostnames = [subquery.strip() for subquery in query.globs if FIELD_VALUE_SEPARATOR not in subquery]
|
|
313
313
|
if not hostnames:
|
|
314
314
|
return True # no hostnames to check
|
|
315
|
+
|
|
315
316
|
short_name = device_data.name.split(".")[0]
|
|
316
317
|
for hostname in hostnames:
|
|
318
|
+
hostname = hostname.strip().rstrip(".")
|
|
317
319
|
if short_name == hostname or device_data.name == hostname:
|
|
318
320
|
return True
|
|
319
321
|
return False
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"Nokia.NS7750": " 7750",
|
|
105
105
|
"Nokia.SR_1s": "SR-1s",
|
|
106
106
|
|
|
107
|
-
"PC": "^(PC|pc|[Mm]ellanox SN|[Ee]dge-?[Cc]ore|[Mm]oxa|NVIDIA|[Aa]sterfusion CX|[Uu]fi[Ss]pace)",
|
|
107
|
+
"PC": "^(PC|pc|[Mm]ellanox SN|[Ee]dge-?[Cc]ore|[Mm]oxa|NVIDIA|Nebius|[Aa]sterfusion CX|[Uu]fi[Ss]pace)",
|
|
108
108
|
|
|
109
109
|
"PC.Whitebox": "([Mm]ellanox SN|[Ee]dge-?[Cc]ore|NVIDIA|[Aa]sterfusion CX|[Uu]fi[Ss]pace)",
|
|
110
110
|
"PC.Whitebox.Mellanox": "[Mm]ellanox",
|
|
@@ -132,6 +132,8 @@
|
|
|
132
132
|
"PC.Whitebox.Ufispace.S": " S",
|
|
133
133
|
"PC.Whitebox.Ufispace.S.S9100": " S91\\d\\d",
|
|
134
134
|
"PC.Whitebox.Ufispace.S.S9100.S9110_32X": " S9110-32X",
|
|
135
|
+
"PC.Nebius": "^Nebius",
|
|
136
|
+
"PC.Nebius.NB-E-BR-DCU-AST2600": "^Nebius NB-E-BR-DCU-AST2600",
|
|
135
137
|
|
|
136
138
|
"RouterOS": "^([Rr]outer[Oo][Ss]|[Mm]ikro[Tt]ik)",
|
|
137
139
|
|
annet/bgp_models.py
CHANGED
|
@@ -245,8 +245,10 @@ class VrfOptions:
|
|
|
245
245
|
l2vpn_evpn: FamilyOptions
|
|
246
246
|
|
|
247
247
|
vrf_name_global: Optional[str] = None
|
|
248
|
-
|
|
248
|
+
import_policy: str = ""
|
|
249
|
+
export_policy: str = ""
|
|
249
250
|
as_path_relax: bool = False
|
|
251
|
+
l3vni: Optional[int] = None
|
|
250
252
|
rt_import: list[str] = field(default_factory=list)
|
|
251
253
|
rt_export: list[str] = field(default_factory=list)
|
|
252
254
|
rt_import_v4: list[str] = field(default_factory=list)
|
|
@@ -281,7 +283,7 @@ class BgpConfig:
|
|
|
281
283
|
peers: list[Peer]
|
|
282
284
|
|
|
283
285
|
|
|
284
|
-
def _used_policies(peer: Union[Peer, PeerGroup]) -> Iterable[str]:
|
|
286
|
+
def _used_policies(peer: Union[Peer, PeerGroup, VrfOptions]) -> Iterable[str]:
|
|
285
287
|
if peer.import_policy:
|
|
286
288
|
yield peer.import_policy
|
|
287
289
|
if peer.export_policy:
|
|
@@ -309,6 +311,7 @@ def extract_policies(config: BgpConfig) -> Sequence[str]:
|
|
|
309
311
|
for group in vrf.groups:
|
|
310
312
|
result.extend(_used_policies(group))
|
|
311
313
|
result.extend(_used_redistribute_policies(vrf))
|
|
314
|
+
result.extend(_used_policies(vrf))
|
|
312
315
|
for group in config.global_options.groups:
|
|
313
316
|
result.extend(_used_policies(group))
|
|
314
317
|
for peer in config.peers:
|
|
@@ -110,7 +110,9 @@ class PrefixListFilterGenerator(PartialGenerator, ABC):
|
|
|
110
110
|
def acl_arista(self, _):
|
|
111
111
|
return r"""
|
|
112
112
|
ip prefix-list
|
|
113
|
+
seq
|
|
113
114
|
ipv6 prefix-list
|
|
115
|
+
seq
|
|
114
116
|
"""
|
|
115
117
|
|
|
116
118
|
def _arista_prefix_list(
|
|
@@ -120,21 +122,18 @@ class PrefixListFilterGenerator(PartialGenerator, ABC):
|
|
|
120
122
|
match: PrefixMatchValue,
|
|
121
123
|
plist: IpPrefixList,
|
|
122
124
|
) -> Iterable[Sequence[str]]:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
) + (
|
|
136
|
-
("le", str(match.less_equal)) if match.less_equal is not None else ()
|
|
137
|
-
)
|
|
125
|
+
with self.block(prefix_type, "prefix-list", name):
|
|
126
|
+
for i, prefix in enumerate(plist.members):
|
|
127
|
+
addr_mask = ip_interface(prefix)
|
|
128
|
+
yield (
|
|
129
|
+
f"seq {i * 10 + 10}",
|
|
130
|
+
"permit",
|
|
131
|
+
addr_mask.with_prefixlen,
|
|
132
|
+
) + (
|
|
133
|
+
("ge", str(match.greater_equal)) if match.greater_equal is not None else ()
|
|
134
|
+
) + (
|
|
135
|
+
("le", str(match.less_equal)) if match.less_equal is not None else ()
|
|
136
|
+
)
|
|
138
137
|
|
|
139
138
|
def run_arista(self, device: Any):
|
|
140
139
|
policies = self.get_policies(device)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: annet
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: annet
|
|
5
5
|
Home-page: https://github.com/annetutil/annet
|
|
6
6
|
License: MIT
|
|
@@ -23,7 +23,7 @@ Requires-Dist: yarl>=1.8.2
|
|
|
23
23
|
Requires-Dist: adaptix==3.0.0b7
|
|
24
24
|
Requires-Dist: dataclass-rest==0.4
|
|
25
25
|
Provides-Extra: netbox
|
|
26
|
-
Requires-Dist: annetbox[sync]>=0.1.
|
|
26
|
+
Requires-Dist: annetbox[sync]>=0.1.13; extra == "netbox"
|
|
27
27
|
Dynamic: home-page
|
|
28
28
|
Dynamic: license
|
|
29
29
|
Dynamic: provides-extra
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
annet/__init__.py,sha256=W8kkZ3Axu-6VJwgQ0cn4UeOVNy6jab0cqgHKLQny1D0,2141
|
|
2
2
|
annet/annet.py,sha256=TMdEuM7GJQ4TjRVmuK3bCTZN-21lxjQ9sXqEdILUuBk,725
|
|
3
3
|
annet/argparse.py,sha256=v1MfhjR0B8qahza0WinmXClpR8UiDFhmwDDWtNroJPA,12855
|
|
4
|
-
annet/bgp_models.py,sha256=
|
|
4
|
+
annet/bgp_models.py,sha256=no4Ud2EsjYvcoiwNs17wjWDlrBPPg0Me24x0zsNIXWA,9639
|
|
5
5
|
annet/cli.py,sha256=hDpjIr3w47lgQ_CvCQS1SXFDK-SJrf5slbT__5u6GIA,12342
|
|
6
6
|
annet/cli_args.py,sha256=KQlihxSl-Phhq1-9oJDdNSbIllEX55LlPfH6viEKOuw,13483
|
|
7
7
|
annet/connectors.py,sha256=-Lghz3PtWCBU8Ohrp0KKQcmm1AUZtN0EnOaZ6IQgCQI,5105
|
|
@@ -33,15 +33,15 @@ annet/adapters/netbox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
|
33
33
|
annet/adapters/netbox/provider.py,sha256=3IrfZ6CfCxf-lTnJlIC2TQ8M_rDxOB_B7HGXZ92vAgA,1643
|
|
34
34
|
annet/adapters/netbox/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
annet/adapters/netbox/common/client.py,sha256=PaxHG4W9H8_uunIwMBNYkLq4eQJYoO6p6gY-ciQs7Nc,2563
|
|
36
|
-
annet/adapters/netbox/common/manufacturer.py,sha256=
|
|
37
|
-
annet/adapters/netbox/common/models.py,sha256=
|
|
38
|
-
annet/adapters/netbox/common/query.py,sha256=
|
|
36
|
+
annet/adapters/netbox/common/manufacturer.py,sha256=Y9kqU13q6fwYu0_HiotUKAy7OHFZngkC2s3s4IDAbDg,1745
|
|
37
|
+
annet/adapters/netbox/common/models.py,sha256=oqmFF1SbsehgQlMdWVAX_m8m39nCQ31Ycz-fcLLtXpQ,7436
|
|
38
|
+
annet/adapters/netbox/common/query.py,sha256=G4cBSgUs_SYRCsxHjeyyxsCMlRKieP6h2isUjd--du0,1803
|
|
39
39
|
annet/adapters/netbox/common/status_client.py,sha256=XXx0glomaBaglmkUEy6YtFOxQQkHb59CDA0h1I-IhxM,592
|
|
40
40
|
annet/adapters/netbox/common/storage_opts.py,sha256=5tt6wxUUJTIzNbOVXMnYBwZedNAIqYlve3YWl6GdbZM,1197
|
|
41
41
|
annet/adapters/netbox/v24/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
42
|
annet/adapters/netbox/v24/storage.py,sha256=THI592VLx3ehixsPZQ1Ko3mYIAZQbnDY-toIziqBbL8,6005
|
|
43
43
|
annet/adapters/netbox/v37/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
|
-
annet/adapters/netbox/v37/storage.py,sha256=
|
|
44
|
+
annet/adapters/netbox/v37/storage.py,sha256=JUXAt4l2mgE6G3L2JGyvK065Ybqof5R20ixqJ1s_dCU,12770
|
|
45
45
|
annet/annlib/__init__.py,sha256=fT1l4xV5fqqg8HPw9HqmZVN2qwS8i6X1aIm2zGDjxKY,252
|
|
46
46
|
annet/annlib/command.py,sha256=uuBddMQphtn8P5MO5kzIa8_QrtMns-k05VeKv1bcAuA,1043
|
|
47
47
|
annet/annlib/diff.py,sha256=MZ6eQAU3cadQp8KaSE6uAYFtcfMDCIe_eNuVROnYkCk,4496
|
|
@@ -56,7 +56,7 @@ annet/annlib/types.py,sha256=VHU0CBADfYmO0xzB_c5f-mcuU3dUumuJczQnqGlib9M,852
|
|
|
56
56
|
annet/annlib/netdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
57
|
annet/annlib/netdev/db.py,sha256=fI_u5aya4l61mbYSjj4JwlVfi3s7obt2jqERSuXGRUI,1634
|
|
58
58
|
annet/annlib/netdev/devdb/__init__.py,sha256=aKYjjLbJebdKBjnGDpVLQdSqrV2JL24spGm58tmMWVU,892
|
|
59
|
-
annet/annlib/netdev/devdb/data/devdb.json,sha256=
|
|
59
|
+
annet/annlib/netdev/devdb/data/devdb.json,sha256=4zTtgZw0SagYZuyItYiwoFxUAsQ1NTXfn2MjRSh-b4U,6387
|
|
60
60
|
annet/annlib/netdev/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
61
|
annet/annlib/netdev/views/dump.py,sha256=rIlyvnA3uM8bB_7oq1nS2KDxTp6dQh2hz-FbNhYIpOU,4630
|
|
62
62
|
annet/annlib/netdev/views/hardware.py,sha256=3JCZLH7deIHhCguwPJTUX-WDvWjG_xt6BdSEZSO6zkQ,4226
|
|
@@ -106,7 +106,7 @@ annet/rpl_generators/cumulus_frr.py,sha256=F-LRT-UPnztUqinp3KYKqh796L9dqkzPKBUxM
|
|
|
106
106
|
annet/rpl_generators/entities.py,sha256=DIpgAQ8Tslo2hq6iFBaYkJX12BFBiccN8GOaRVxR1Uk,1985
|
|
107
107
|
annet/rpl_generators/execute.py,sha256=wS6e6fwcPWywsHB0gBMqZ17eF0s4YOBgDgwPB_cr5Rw,431
|
|
108
108
|
annet/rpl_generators/policy.py,sha256=NeqB0reRN_KuY8LYkeGT3dRPe2HFDT9RfmVy5fcA3zw,32570
|
|
109
|
-
annet/rpl_generators/prefix_lists.py,sha256=
|
|
109
|
+
annet/rpl_generators/prefix_lists.py,sha256=D4WXeISevf62EmDu1GYdldjz2gmONFFlmgMyGAOa_m8,7248
|
|
110
110
|
annet/rpl_generators/rd.py,sha256=YGXgx1D2D0-pixgspXJzA6NvW8lx3AmHMxIY2l5rraI,1457
|
|
111
111
|
annet/rulebook/__init__.py,sha256=oafL5HC8QHdkO9CH2q_fxohPMxOgjn-dNQa5kPjuqsA,3942
|
|
112
112
|
annet/rulebook/common.py,sha256=zK1s2c5lc5HQbIlMUQ4HARQudXSgOYiZ_Sxc2I_tHqg,721
|
|
@@ -137,7 +137,7 @@ annet/rulebook/ribbon/__init__.py,sha256=TRbkQVvk0-HxkUQW9-LmiG6XIfTZ-8t3SiaDemN
|
|
|
137
137
|
annet/rulebook/routeros/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
138
138
|
annet/rulebook/routeros/file.py,sha256=zK7RwBk1YaVoDSFSg1u7Pt8u0Fk3nhhu27aJRngemwc,137
|
|
139
139
|
annet/rulebook/texts/arista.deploy,sha256=OS9eFyJpEPztcOHkBwajw_RTJfTT7ivaMHfx4_HXaUg,792
|
|
140
|
-
annet/rulebook/texts/arista.order,sha256=
|
|
140
|
+
annet/rulebook/texts/arista.order,sha256=e7e5pnzMZAfmXJ0sUaaWmep6JMeErNnd7DkouUVIZsU,1472
|
|
141
141
|
annet/rulebook/texts/arista.rul,sha256=QQbro8eFlc7DCHk0-CTHX_rnj5rqumRzXlY60ga72jo,815
|
|
142
142
|
annet/rulebook/texts/aruba.deploy,sha256=hI432Bq-of_LMXuUflCu7eNSEFpx6qmj0KItEw6sgHI,841
|
|
143
143
|
annet/rulebook/texts/aruba.order,sha256=ZMakkn0EJ9zomgY6VssoptJImrHrUmYnCqivzLBFTRo,1158
|
|
@@ -177,10 +177,10 @@ annet_generators/rpl_example/generator.py,sha256=zndIGfV4ZlTxPgAGYs7bMQvTc_tYScO
|
|
|
177
177
|
annet_generators/rpl_example/items.py,sha256=Ez1RF5YhcXNCusBmeApIjRL3rBlMazNZd29Gpw1_IsA,766
|
|
178
178
|
annet_generators/rpl_example/mesh.py,sha256=z_WgfDZZ4xnyh3cSf75igyH09hGvtexEVwy1gCD_DzA,288
|
|
179
179
|
annet_generators/rpl_example/route_policy.py,sha256=z6nPb0VDeQtKD1NIg9sFvmUxBD5tVs2frfNIuKdM-5c,2318
|
|
180
|
-
annet-1.0.
|
|
181
|
-
annet-1.0.
|
|
182
|
-
annet-1.0.
|
|
183
|
-
annet-1.0.
|
|
184
|
-
annet-1.0.
|
|
185
|
-
annet-1.0.
|
|
186
|
-
annet-1.0.
|
|
180
|
+
annet-1.0.2.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
|
|
181
|
+
annet-1.0.2.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
|
|
182
|
+
annet-1.0.2.dist-info/METADATA,sha256=SgpphAgeLtz8cqAk20g2sfp52cTs6t_jTNvpThBJ2oI,852
|
|
183
|
+
annet-1.0.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
184
|
+
annet-1.0.2.dist-info/entry_points.txt,sha256=5lIaDGlGi3l6QQ2ry2jZaqViP5Lvt8AmsegdD0Uznck,192
|
|
185
|
+
annet-1.0.2.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
|
|
186
|
+
annet-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|