gnetcli-adapter 2.4.2__tar.gz → 2.5.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: gnetcli_adapter
3
- Version: 2.4.2
3
+ Version: 2.5.0
4
4
  Summary: Gnetcli-server adapter for Annet
5
5
  Author-email: Aleksandr Balezin <gescheit12@gmail.com>
6
6
  Requires-Python: >=3.10
@@ -12,6 +12,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
12
12
  Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
14
14
  License-File: LICENSE
15
+ Requires-Dist: exceptiongroup>=1.1.3; python_version<'3.11'
15
16
  Requires-Dist: annet>=3.2.0
16
17
  Requires-Dist: gnetclisdk>=1.0.90
17
18
  Requires-Dist: pydantic_settings
@@ -5,6 +5,7 @@ build-backend = "flit_core.buildapi"
5
5
  [project]
6
6
  name = "gnetcli_adapter"
7
7
  dependencies = [
8
+ "exceptiongroup>=1.1.3; python_version<'3.11'",
8
9
  "annet>=3.2.0",
9
10
  "gnetclisdk>=1.0.90",
10
11
  "pydantic_settings",
@@ -32,6 +32,14 @@ import threading
32
32
  import atexit
33
33
  import shutil
34
34
  import os.path
35
+ try:
36
+ from builtins import ( # type: ignore[attr-defined, unused-ignore]
37
+ ExceptionGroup,
38
+ )
39
+ except ImportError:
40
+ from exceptiongroup import ( # type: ignore[no-redef, import-not-found, unused-ignore]
41
+ ExceptionGroup,
42
+ )
35
43
 
36
44
  breed_to_device = {
37
45
  "routeros": "ros",
@@ -467,7 +475,7 @@ class GnetcliDeployer(DeployDriver, AdapterWithConfig, AdapterWithName):
467
475
  cmds: CommandList,
468
476
  args: DeployOptions,
469
477
  progress_bar: ProgressBar | None = None,
470
- ) -> tuple[list[Exception], list[pb.CMDResult]]:
478
+ ) -> Exception | None:
471
479
  gnetcli_device = breed_to_device.get(device.breed, device.breed)
472
480
  ip = get_device_ip(device)
473
481
  host_params = HostParams(
@@ -506,7 +514,10 @@ class GnetcliDeployer(DeployDriver, AdapterWithConfig, AdapterWithName):
506
514
  tracker.finish_err(f"Seen {len(seen_exc)} exceptions")
507
515
  else:
508
516
  tracker.finish_ok("All done")
509
- return seen_exc, results
517
+
518
+ if seen_exc:
519
+ return ExceptionGroup("Deploy failed with exceptions", seen_exc)
520
+ return None
510
521
 
511
522
  async def _deploy(
512
523
  self,
File without changes