acex-driver-juniper-junoscli 2.1.0__tar.gz → 2.2.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: acex-driver-juniper-junoscli
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: ACE-X Driver: Juniper Junos CLI
5
5
  License: AGPL-3.0
6
6
  Author: Johan Lahti
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "acex-driver-juniper-junoscli"
3
- version = "2.1.0"
3
+ version = "2.2.0"
4
4
  description = "ACE-X Driver: Juniper Junos CLI"
5
5
  authors = ["Johan Lahti <johan.lahti@acebit.se>"]
6
6
  license = "AGPL-3.0"
@@ -3,6 +3,21 @@
3
3
  "component": "acex-driver-juniper-junoscli",
4
4
  "name": "Juniper Junos CLI driver",
5
5
  "releases": [
6
+ {
7
+ "version": "2.2.0",
8
+ "date": "2026-11-24",
9
+ "entries": [
10
+ {
11
+ "id": "20261117-the-junos-driver-says-why-it-could-not",
12
+ "kind": "changed",
13
+ "title": "The Junos driver says why it could not connect",
14
+ "description": "A refused connection and an SSH negotiation the device does not share are raised as `HostUnreachable` and `SshAlgorithmMismatch` instead of as a timeout, so the collection agent can tell the reasons apart. A real timeout is still `ConnectionTimeout`.",
15
+ "breaking": false,
16
+ "audience": "user",
17
+ "refs": []
18
+ }
19
+ ]
20
+ },
6
21
  {
7
22
  "version": "2.1.0",
8
23
  "date": "2026-11-06",
@@ -3,7 +3,13 @@ import re
3
3
 
4
4
  from acex_devkit.configdiffer import Diff
5
5
  from acex_devkit.drivers import Codec, NetworkElementDriver, State, Transport
6
- from acex_devkit.exceptions import AuthenticationFailed, ConnectionTimeout, DriverException
6
+ from acex_devkit.exceptions import (
7
+ AuthenticationFailed,
8
+ ConnectionTimeout,
9
+ DriverException,
10
+ HostUnreachable,
11
+ SshAlgorithmMismatch,
12
+ )
7
13
  from acex_devkit.models.codec_result import ParseResult, RenderResult
8
14
  from acex_devkit.models.composed_configuration import ComposedConfiguration
9
15
  from acex_devkit.models.lldp_neighbor import LldpNeighborEntry
@@ -44,6 +50,13 @@ class JunosCLITransport(Transport[str]):
44
50
  except NetmikoAuthenticationException as e:
45
51
  raise AuthenticationFailed(f"Authentication to {self.address} failed") from e
46
52
  except NetmikoTimeoutException as e:
53
+ # Netmiko raises this for a refused connection and for a failed SSH negotiation too; the error it caught is
54
+ # the context of the one it raised.
55
+ reason = e.__context__
56
+ if "Incompatible ssh" in str(reason):
57
+ raise SshAlgorithmMismatch(f"No SSH algorithm in common with the device: {reason}") from e
58
+ if isinstance(reason, OSError) and not isinstance(reason, TimeoutError):
59
+ raise HostUnreachable(f"Could not connect to the device: {reason}") from e
47
60
  raise ConnectionTimeout(f"Connection to {self.address} timed out") from e
48
61
 
49
62
  async def close(self) -> None:
@@ -148,3 +161,5 @@ class JunosCLI(NetworkElementDriver):
148
161
  state_class = JunosState
149
162
 
150
163
  platforms = [Platform(vendor=Vendor.juniper, os=OS.juniper_junos)]
164
+
165
+ interface_version = 2