annet 0.16.5__py3-none-any.whl → 0.16.7__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/executor.py CHANGED
@@ -15,6 +15,8 @@ from typing import Any, Callable, Dict, List, Optional, Tuple, Union
15
15
 
16
16
  import colorama
17
17
  import psutil
18
+
19
+ import annet.lib
18
20
  from annet.annlib.command import Command, CommandList, Question # noqa: F401
19
21
  from annet.storage import Device
20
22
 
@@ -146,7 +148,7 @@ def async_bulk(
146
148
  kwargs["policy"] = policy
147
149
 
148
150
  if processes == 1:
149
- host_res, host_duration = asyncio.get_event_loop().run_until_complete(bulk(executor, devices, coro_gen, *args, **kwargs))
151
+ host_res, host_duration = annet.lib.do_async(bulk(executor, devices, coro_gen, *args, **kwargs))
150
152
  res.update(host_res)
151
153
  deploy_durations.update(host_duration)
152
154
  else:
@@ -313,10 +315,7 @@ def _print_failed(host, res):
313
315
 
314
316
 
315
317
  def _mp_async_bulk(res_q: multiprocessing.Queue, *args, **kwargs):
316
- asyncio.get_event_loop().close()
317
- loop = asyncio.new_event_loop()
318
- asyncio.set_event_loop(loop)
319
- res = loop.run_until_complete(bulk(*args, **kwargs))
318
+ res = annet.lib.do_async(bulk(*args, **kwargs))
320
319
  res_q.put(res)
321
320
  res_q.close()
322
321
 
@@ -383,8 +383,15 @@ def _get_generators(module_paths: Union[List[str], dict], storage, device=None):
383
383
  else:
384
384
  modules = []
385
385
  seen = set()
386
+ matched_property = None
386
387
  for prop, prop_modules in module_paths.get("per_device_property", {}).items():
387
388
  if getattr(device, prop, False) is True:
389
+ if matched_property is not None:
390
+ raise RuntimeError(
391
+ f"Device {device.hostname} is matched by more than one "
392
+ f"per_device_property: {matched_property} and {prop}"
393
+ )
394
+ matched_property = prop
388
395
  for module in prop_modules:
389
396
  if module not in seen:
390
397
  modules.append(module)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: annet
3
- Version: 0.16.5
3
+ Version: 0.16.7
4
4
  Summary: annet
5
5
  Home-page: https://github.com/annetutil/annet
6
6
  License: MIT
@@ -6,7 +6,7 @@ annet/cli_args.py,sha256=KQlihxSl-Phhq1-9oJDdNSbIllEX55LlPfH6viEKOuw,13483
6
6
  annet/connectors.py,sha256=-Lghz3PtWCBU8Ohrp0KKQcmm1AUZtN0EnOaZ6IQgCQI,5105
7
7
  annet/deploy.py,sha256=pM7r8ipk7y-b4OIenc8FMqZpy5F6TmKdo8DDUJNRBlY,18956
8
8
  annet/diff.py,sha256=zLcaCnb4lZRUb7frpH1CstQ3kacRcCblZs1uLG8J5lk,3391
9
- annet/executor.py,sha256=FrYAUuh2TpSVX42SlTN_PhuSHmXG4Wj1nieY9Wqv9so,19122
9
+ annet/executor.py,sha256=Jny-hm0otZA1naPpFWR-R16SbaZioSQ8pkx-Yd2PYlM,19004
10
10
  annet/filtering.py,sha256=ZtqxPsKdV9reZoRxtQyBg22BqyMqd-2SotYcxZ-68AQ,903
11
11
  annet/gen.py,sha256=rOAveprvBaEXbLyaQUhQ0QtOvcDfndlIOpchNhu8M1U,33499
12
12
  annet/hardware.py,sha256=_iR28dWiPtt6ZYdk-qg1sxazkSRJE3ukqKB-fFFfQak,1141
@@ -64,7 +64,7 @@ annet/annlib/rulebook/common.py,sha256=Kd9Xout0xC6ZZDnyaORx0W-1kSM-gTgjQbp1iIXWx
64
64
  annet/api/__init__.py,sha256=7EB3d89kGXKf4Huw7cqyOULTGC9ydL4sHiVw8K0Aeqg,33722
65
65
  annet/configs/context.yml,sha256=rXbeCmeYGaCEVVncwdouZIx5O7-PzABe4q-tfke0sSA,389
66
66
  annet/configs/logging.yaml,sha256=Hu42lRK248dssp9TgkbHCaZNl0E6f4IChGb0XaQnTVo,970
67
- annet/generators/__init__.py,sha256=ACMH9UQ4I3uq2b8nDzOn2dgYxreDq4_3ojOGwht0-No,15543
67
+ annet/generators/__init__.py,sha256=rQAA_ghWRY2PcPYU6HArtt6sPEJXuBEEAvyUT9uDDms,15913
68
68
  annet/generators/base.py,sha256=rgQLcQBPZm4ecbKmRhVOpBR-GFJAiVfdb_y5f2-LUR8,3670
69
69
  annet/generators/entire.py,sha256=7WySkVaXNT3ZAiHcQ0JUKdlhGJAN8cNUxF6c7ilYnO8,2928
70
70
  annet/generators/exceptions.py,sha256=GPXTBgn2xZ3Ev_bdOPlfCLGRC1kQHe_dEq88S-uyi5s,151
@@ -133,10 +133,10 @@ annet/rulebook/texts/routeros.rul,sha256=ipfxjj0mjFef6IsUlupqx4BY_Je_OUb8u_U1019
133
133
  annet_generators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
134
134
  annet_generators/example/__init__.py,sha256=zVd8_DrXuOASrNzg2Ab94rPyvJff83L-_HppDFxnUjM,228
135
135
  annet_generators/example/lldp.py,sha256=24bGvShxbio-JxUdaehyPRu31LhH9YwSwFDrWVRn6yo,2100
136
- annet-0.16.5.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
137
- annet-0.16.5.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
138
- annet-0.16.5.dist-info/METADATA,sha256=s7i48H2cWZNBBduNzQd6XuhwK5vwi-wjcBJ0ZyqN6Bk,694
139
- annet-0.16.5.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
140
- annet-0.16.5.dist-info/entry_points.txt,sha256=5lIaDGlGi3l6QQ2ry2jZaqViP5Lvt8AmsegdD0Uznck,192
141
- annet-0.16.5.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
142
- annet-0.16.5.dist-info/RECORD,,
136
+ annet-0.16.7.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
137
+ annet-0.16.7.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
138
+ annet-0.16.7.dist-info/METADATA,sha256=eN7Rx0Uey7FJ-BxUBXbWEcsw7Sdt6CfYaejGBjNdkhY,694
139
+ annet-0.16.7.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
140
+ annet-0.16.7.dist-info/entry_points.txt,sha256=5lIaDGlGi3l6QQ2ry2jZaqViP5Lvt8AmsegdD0Uznck,192
141
+ annet-0.16.7.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
142
+ annet-0.16.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5