annet 0.16.35__py3-none-any.whl → 0.16.36__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.

@@ -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 == "Moxa":
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
- return self.device_type.manufacturer.name in ("Mellanox", "NVIDIA", "Moxa") or self.breed == "pc"
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(
@@ -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
- l3vni: Optional[int] = None
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:
@@ -128,8 +128,7 @@ class PrefixListFilterGenerator(PartialGenerator, ABC):
128
128
  name,
129
129
  f"seq {i * 5 + 5}",
130
130
  "permit",
131
- str(addr_mask.ip).upper(),
132
- str(addr_mask.network.prefixlen),
131
+ addr_mask.with_prefixlen,
133
132
  ) + (
134
133
  ("ge", str(match.greater_equal)) if match.greater_equal is not None else ()
135
134
  ) + (
@@ -88,6 +88,7 @@ interface
88
88
 
89
89
  (?:ip|ipv6) routing
90
90
 
91
+ ip prefix-list
91
92
 
92
93
  ip community-list
93
94
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: annet
3
- Version: 0.16.35
3
+ Version: 0.16.36
4
4
  Summary: annet
5
5
  Home-page: https://github.com/annetutil/annet
6
6
  License: MIT
@@ -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=M2gtOJMsua8SlUySc57VtG71-TmydxP1bthQEcUVpNo,9528
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
@@ -32,15 +32,15 @@ annet/adapters/netbox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
32
32
  annet/adapters/netbox/provider.py,sha256=3IrfZ6CfCxf-lTnJlIC2TQ8M_rDxOB_B7HGXZ92vAgA,1643
33
33
  annet/adapters/netbox/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  annet/adapters/netbox/common/client.py,sha256=PaxHG4W9H8_uunIwMBNYkLq4eQJYoO6p6gY-ciQs7Nc,2563
35
- annet/adapters/netbox/common/manufacturer.py,sha256=LAPT6OlV_ew96GhtwNrCpeiT0IGrg2_9__MMdZk431U,1733
36
- annet/adapters/netbox/common/models.py,sha256=Xq6Dc3kY9_QyvS9DiKEq1AxjTxiF4qEKhs1EMtBw-k4,7384
35
+ annet/adapters/netbox/common/manufacturer.py,sha256=Y9kqU13q6fwYu0_HiotUKAy7OHFZngkC2s3s4IDAbDg,1745
36
+ annet/adapters/netbox/common/models.py,sha256=oqmFF1SbsehgQlMdWVAX_m8m39nCQ31Ycz-fcLLtXpQ,7436
37
37
  annet/adapters/netbox/common/query.py,sha256=mv5WlU6gGge8gUYwloXDXEABmfP5teYyq8DyBtGdFkw,1761
38
38
  annet/adapters/netbox/common/status_client.py,sha256=XXx0glomaBaglmkUEy6YtFOxQQkHb59CDA0h1I-IhxM,592
39
39
  annet/adapters/netbox/common/storage_opts.py,sha256=5tt6wxUUJTIzNbOVXMnYBwZedNAIqYlve3YWl6GdbZM,1197
40
40
  annet/adapters/netbox/v24/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  annet/adapters/netbox/v24/storage.py,sha256=THI592VLx3ehixsPZQ1Ko3mYIAZQbnDY-toIziqBbL8,6005
42
42
  annet/adapters/netbox/v37/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
- annet/adapters/netbox/v37/storage.py,sha256=noG-Lt1ZRiXm_uJE8xTRBsEvnEWcB1p2Uszuz6zECiI,12721
43
+ annet/adapters/netbox/v37/storage.py,sha256=JUXAt4l2mgE6G3L2JGyvK065Ybqof5R20ixqJ1s_dCU,12770
44
44
  annet/annlib/__init__.py,sha256=fT1l4xV5fqqg8HPw9HqmZVN2qwS8i6X1aIm2zGDjxKY,252
45
45
  annet/annlib/command.py,sha256=uuBddMQphtn8P5MO5kzIa8_QrtMns-k05VeKv1bcAuA,1043
46
46
  annet/annlib/diff.py,sha256=MZ6eQAU3cadQp8KaSE6uAYFtcfMDCIe_eNuVROnYkCk,4496
@@ -55,7 +55,7 @@ annet/annlib/types.py,sha256=VHU0CBADfYmO0xzB_c5f-mcuU3dUumuJczQnqGlib9M,852
55
55
  annet/annlib/netdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
56
  annet/annlib/netdev/db.py,sha256=fI_u5aya4l61mbYSjj4JwlVfi3s7obt2jqERSuXGRUI,1634
57
57
  annet/annlib/netdev/devdb/__init__.py,sha256=aKYjjLbJebdKBjnGDpVLQdSqrV2JL24spGm58tmMWVU,892
58
- annet/annlib/netdev/devdb/data/devdb.json,sha256=DBl8iU2K_tydteB_a8mXUlgrv_Na3UXSJschuhyjsqs,6284
58
+ annet/annlib/netdev/devdb/data/devdb.json,sha256=4zTtgZw0SagYZuyItYiwoFxUAsQ1NTXfn2MjRSh-b4U,6387
59
59
  annet/annlib/netdev/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
60
  annet/annlib/netdev/views/dump.py,sha256=rIlyvnA3uM8bB_7oq1nS2KDxTp6dQh2hz-FbNhYIpOU,4630
61
61
  annet/annlib/netdev/views/hardware.py,sha256=3JCZLH7deIHhCguwPJTUX-WDvWjG_xt6BdSEZSO6zkQ,4226
@@ -105,7 +105,7 @@ annet/rpl_generators/cumulus_frr.py,sha256=F-LRT-UPnztUqinp3KYKqh796L9dqkzPKBUxM
105
105
  annet/rpl_generators/entities.py,sha256=DIpgAQ8Tslo2hq6iFBaYkJX12BFBiccN8GOaRVxR1Uk,1985
106
106
  annet/rpl_generators/execute.py,sha256=wS6e6fwcPWywsHB0gBMqZ17eF0s4YOBgDgwPB_cr5Rw,431
107
107
  annet/rpl_generators/policy.py,sha256=NeqB0reRN_KuY8LYkeGT3dRPe2HFDT9RfmVy5fcA3zw,32570
108
- annet/rpl_generators/prefix_lists.py,sha256=GyNbqXvRVGiuetLSXG2kQidRUXPMEAhR74AJJFSDQZc,7244
108
+ annet/rpl_generators/prefix_lists.py,sha256=69vr7Yd6rQ9m6S8ksevSNCgegc4Qo445usEFUzGhAuU,7193
109
109
  annet/rpl_generators/rd.py,sha256=YGXgx1D2D0-pixgspXJzA6NvW8lx3AmHMxIY2l5rraI,1457
110
110
  annet/rulebook/__init__.py,sha256=oafL5HC8QHdkO9CH2q_fxohPMxOgjn-dNQa5kPjuqsA,3942
111
111
  annet/rulebook/common.py,sha256=zK1s2c5lc5HQbIlMUQ4HARQudXSgOYiZ_Sxc2I_tHqg,721
@@ -136,7 +136,7 @@ annet/rulebook/ribbon/__init__.py,sha256=TRbkQVvk0-HxkUQW9-LmiG6XIfTZ-8t3SiaDemN
136
136
  annet/rulebook/routeros/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
137
137
  annet/rulebook/routeros/file.py,sha256=zK7RwBk1YaVoDSFSg1u7Pt8u0Fk3nhhu27aJRngemwc,137
138
138
  annet/rulebook/texts/arista.deploy,sha256=OS9eFyJpEPztcOHkBwajw_RTJfTT7ivaMHfx4_HXaUg,792
139
- annet/rulebook/texts/arista.order,sha256=TKy3S56tIypwfVaw0akK1sXGatCpLVwpB4Jvq-dIu90,1457
139
+ annet/rulebook/texts/arista.order,sha256=e7e5pnzMZAfmXJ0sUaaWmep6JMeErNnd7DkouUVIZsU,1472
140
140
  annet/rulebook/texts/arista.rul,sha256=QQbro8eFlc7DCHk0-CTHX_rnj5rqumRzXlY60ga72jo,815
141
141
  annet/rulebook/texts/aruba.deploy,sha256=hI432Bq-of_LMXuUflCu7eNSEFpx6qmj0KItEw6sgHI,841
142
142
  annet/rulebook/texts/aruba.order,sha256=ZMakkn0EJ9zomgY6VssoptJImrHrUmYnCqivzLBFTRo,1158
@@ -176,10 +176,10 @@ annet_generators/rpl_example/generator.py,sha256=zndIGfV4ZlTxPgAGYs7bMQvTc_tYScO
176
176
  annet_generators/rpl_example/items.py,sha256=Ez1RF5YhcXNCusBmeApIjRL3rBlMazNZd29Gpw1_IsA,766
177
177
  annet_generators/rpl_example/mesh.py,sha256=z_WgfDZZ4xnyh3cSf75igyH09hGvtexEVwy1gCD_DzA,288
178
178
  annet_generators/rpl_example/route_policy.py,sha256=z6nPb0VDeQtKD1NIg9sFvmUxBD5tVs2frfNIuKdM-5c,2318
179
- annet-0.16.35.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
180
- annet-0.16.35.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
181
- annet-0.16.35.dist-info/METADATA,sha256=XiL8MGmXK4eW_mXEUkn6P6AoDJYlKpqdzAeom1JFr8Q,854
182
- annet-0.16.35.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
183
- annet-0.16.35.dist-info/entry_points.txt,sha256=5lIaDGlGi3l6QQ2ry2jZaqViP5Lvt8AmsegdD0Uznck,192
184
- annet-0.16.35.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
185
- annet-0.16.35.dist-info/RECORD,,
179
+ annet-0.16.36.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
180
+ annet-0.16.36.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
181
+ annet-0.16.36.dist-info/METADATA,sha256=H4zXSdqH1KdZu_hYHp8IkARj044NR3K9tUZsDO8l_mo,854
182
+ annet-0.16.36.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
183
+ annet-0.16.36.dist-info/entry_points.txt,sha256=5lIaDGlGi3l6QQ2ry2jZaqViP5Lvt8AmsegdD0Uznck,192
184
+ annet-0.16.36.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
185
+ annet-0.16.36.dist-info/RECORD,,