annet 0.12.5__py3-none-any.whl → 0.12.6__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/api/__init__.py CHANGED
@@ -221,9 +221,8 @@ def log_host_progress_cb(pool: Parallel, task_result: TaskResult):
221
221
  connector = storage_connector.get()
222
222
  storage_opts = connector.opts().from_cli_opts(args)
223
223
  with connector.storage()(storage_opts) as storage:
224
- hosts = storage.resolve_fdnds_by_query(args.query)
225
- fqdn = hosts[task_result.device_id]
226
- PoolProgressLogger(device_fqdns=fqdn)(pool, task_result)
224
+ fqdns = storage.resolve_fdnds_by_query(args.query)
225
+ PoolProgressLogger(device_fqdns=fqdns)(pool, task_result)
227
226
 
228
227
 
229
228
  # =====
annet/gen.py CHANGED
@@ -378,7 +378,11 @@ def old_new(
378
378
  do_files_download=False,
379
379
  do_print_perf=True,
380
380
  ):
381
- devices = loader.devices
381
+ if device_ids is None:
382
+ devices = loader.devices
383
+ else:
384
+ devices = [loader.get_device(device_id) for device_id in device_ids]
385
+
382
386
  gens = loader.resolve_gens(devices)
383
387
  running, failed_running = _old_resolve_running(config, devices)
384
388
  downloaded_files, failed_files = _old_resolve_files(config, devices, gens, do_files_download)
@@ -819,7 +823,7 @@ class Loader:
819
823
  self._args = args
820
824
  self._storages = storages
821
825
  self._no_empty_warning = no_empty_warning
822
- self._devices_map: Dict[int, Device] = {}
826
+ self._devices_map: Dict[Any, Device] = {}
823
827
  self._gens: DeviceGenerators = DeviceGenerators()
824
828
 
825
829
  self._preload()
@@ -843,14 +847,19 @@ class Loader:
843
847
  return
844
848
 
845
849
  @property
846
- def device_fqdns(self):
850
+ def device_fqdns(self) -> Dict[Any, str]:
847
851
  return {
848
852
  device_id: d.fqdn
849
853
  for device_id, d in self._devices_map.items()
850
854
  }
851
855
 
856
+ def get_device(self, device_id: Any) -> Device:
857
+ if device_id not in self._devices_map:
858
+ raise KeyError(f"Unknown device with id {device_id}")
859
+ return self._devices_map[device_id]
860
+
852
861
  @property
853
- def device_ids(self):
862
+ def device_ids(self) -> List[Any]:
854
863
  return list(self._devices_map)
855
864
 
856
865
  @property
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: annet
3
- Version: 0.12.5
3
+ Version: 0.12.6
4
4
  Summary: annet
5
5
  Home-page: https://github.com/annetutil/annet
6
6
  License: MIT
@@ -8,7 +8,7 @@ annet/deploy.py,sha256=B8E0P_VvCrS2URjFvgmUiIkHp95g7pAWfmT34igaDeo,18893
8
8
  annet/diff.py,sha256=zLcaCnb4lZRUb7frpH1CstQ3kacRcCblZs1uLG8J5lk,3391
9
9
  annet/executor.py,sha256=bw7COJNtssuxIqbQehlHYJnkdUeYvvL8WO5B-c67XE0,19040
10
10
  annet/filtering.py,sha256=F4ZKUCU3Yb1RlL2zKdyHtVUaWPzjWF4vWyMcdygKNYk,852
11
- annet/gen.py,sha256=f2Prqn0MMEkNT-CdqI_Zb7R9_iaUA8dBS5nr67ShUws,32502
11
+ annet/gen.py,sha256=j8ldncYAGTUmuQermnAuP8lt278Mz5ubPx0JSkeGWgc,32862
12
12
  annet/hardware.py,sha256=HYPDfji_GdRn5S0_0fl4rvM7byOY9aHxG6VMAtsLaxE,1090
13
13
  annet/implicit.py,sha256=QigK4uoxvrFho2h9yFjOq1d9rLsC5xFlAU4bKkCuMWk,5139
14
14
  annet/lib.py,sha256=zQIfNBg7fAAk2BHbHAqy_McAiXhz0RqpBAcfdU-6pAA,3742
@@ -65,7 +65,7 @@ annet/annlib/rbparser/platform.py,sha256=iyqy4A-6vUKM4j6hrOA6tsgWBXk7LcvkFrS2QHg
65
65
  annet/annlib/rbparser/syntax.py,sha256=eEUmszwPjdw57aofUYNQVcaxHPNV9yx9JNapjYY-BGM,3572
66
66
  annet/annlib/rulebook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
67
  annet/annlib/rulebook/common.py,sha256=9kCZwZpsH5UliF2OzaN9nLs2eLlz_d__4L7_oZ3SrCw,16054
68
- annet/api/__init__.py,sha256=LDl_JB_azU3v-sI5EwsJkiMDm_zZ7zYFBx8FHDW3Eag,33180
68
+ annet/api/__init__.py,sha256=nrtPSDGLk5GO6nKSXDx9PNrCyiDBCJRXuUG1ua_y9MM,33141
69
69
  annet/configs/context.yml,sha256=nt4QnzYzrG2hqmaWOUsab2wgFl-CXmFSzbto6rqqFt4,291
70
70
  annet/configs/logging.yaml,sha256=Hu42lRK248dssp9TgkbHCaZNl0E6f4IChGb0XaQnTVo,970
71
71
  annet/generators/__init__.py,sha256=ZWKdxy6XbANW8vO6Tz7TMP_5rkHHKPBiBhPK2g-NOvI,15609
@@ -128,10 +128,10 @@ annet/rulebook/texts/routeros.rul,sha256=ipfxjj0mjFef6IsUlupqx4BY_Je_OUb8u_U1019
128
128
  annet_generators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
129
129
  annet_generators/example/__init__.py,sha256=zVd8_DrXuOASrNzg2Ab94rPyvJff83L-_HppDFxnUjM,228
130
130
  annet_generators/example/lldp.py,sha256=68CLrK7vxTQQy9XIBxtywuEdBNlIlfXGYj8_wYWs5UI,1146
131
- annet-0.12.5.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
132
- annet-0.12.5.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
133
- annet-0.12.5.dist-info/METADATA,sha256=kFuaps_0RVxV1AnE5VK3Q1wwCl7p21QD5t1MzJZVp74,694
134
- annet-0.12.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
135
- annet-0.12.5.dist-info/entry_points.txt,sha256=yHimujIzR2bwNIbb--MTs_GpXiAve89Egpu2LlgTEkg,119
136
- annet-0.12.5.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
137
- annet-0.12.5.dist-info/RECORD,,
131
+ annet-0.12.6.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
132
+ annet-0.12.6.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
133
+ annet-0.12.6.dist-info/METADATA,sha256=T6AvsDaqSWsBAZ0Q2MyGJzdyWnUhb-GtI7OV0pefjxg,694
134
+ annet-0.12.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
135
+ annet-0.12.6.dist-info/entry_points.txt,sha256=yHimujIzR2bwNIbb--MTs_GpXiAve89Egpu2LlgTEkg,119
136
+ annet-0.12.6.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
137
+ annet-0.12.6.dist-info/RECORD,,
File without changes