annet 0.12.4__tar.gz → 0.12.6__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.

Potentially problematic release.


This version of annet might be problematic. Click here for more details.

Files changed (144) hide show
  1. {annet-0.12.4/annet.egg-info → annet-0.12.6}/PKG-INFO +1 -1
  2. {annet-0.12.4 → annet-0.12.6}/annet/api/__init__.py +2 -3
  3. {annet-0.12.4 → annet-0.12.6}/annet/gen.py +15 -4
  4. {annet-0.12.4 → annet-0.12.6}/annet/generators/perf.py +2 -1
  5. {annet-0.12.4 → annet-0.12.6}/annet/types.py +6 -1
  6. {annet-0.12.4 → annet-0.12.6/annet.egg-info}/PKG-INFO +1 -1
  7. {annet-0.12.4 → annet-0.12.6}/AUTHORS +0 -0
  8. {annet-0.12.4 → annet-0.12.6}/LICENSE +0 -0
  9. {annet-0.12.4 → annet-0.12.6}/MANIFEST.in +0 -0
  10. {annet-0.12.4 → annet-0.12.6}/README.md +0 -0
  11. {annet-0.12.4 → annet-0.12.6}/annet/__init__.py +0 -0
  12. {annet-0.12.4 → annet-0.12.6}/annet/adapters/__init__.py +0 -0
  13. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/__init__.py +0 -0
  14. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/common/__init__.py +0 -0
  15. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/common/client.py +0 -0
  16. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/common/manufacturer.py +0 -0
  17. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/common/models.py +0 -0
  18. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/common/query.py +0 -0
  19. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/common/status_client.py +0 -0
  20. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/common/storage_opts.py +0 -0
  21. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/provider.py +0 -0
  22. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/v24/__init__.py +0 -0
  23. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/v24/api_models.py +0 -0
  24. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/v24/client.py +0 -0
  25. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/v24/storage.py +0 -0
  26. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/v37/__init__.py +0 -0
  27. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/v37/api_models.py +0 -0
  28. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/v37/client.py +0 -0
  29. {annet-0.12.4 → annet-0.12.6}/annet/adapters/netbox/v37/storage.py +0 -0
  30. {annet-0.12.4 → annet-0.12.6}/annet/annet.py +0 -0
  31. {annet-0.12.4 → annet-0.12.6}/annet/annlib/__init__.py +0 -0
  32. {annet-0.12.4 → annet-0.12.6}/annet/annlib/command.py +0 -0
  33. {annet-0.12.4 → annet-0.12.6}/annet/annlib/diff.py +0 -0
  34. {annet-0.12.4 → annet-0.12.6}/annet/annlib/errors.py +0 -0
  35. {annet-0.12.4 → annet-0.12.6}/annet/annlib/filter_acl.py +0 -0
  36. {annet-0.12.4 → annet-0.12.6}/annet/annlib/jsontools.py +0 -0
  37. {annet-0.12.4 → annet-0.12.6}/annet/annlib/lib.py +0 -0
  38. {annet-0.12.4 → annet-0.12.6}/annet/annlib/netdev/__init__.py +0 -0
  39. {annet-0.12.4 → annet-0.12.6}/annet/annlib/netdev/db.py +0 -0
  40. {annet-0.12.4 → annet-0.12.6}/annet/annlib/netdev/devdb/__init__.py +0 -0
  41. {annet-0.12.4 → annet-0.12.6}/annet/annlib/netdev/devdb/data/devdb.json +0 -0
  42. {annet-0.12.4 → annet-0.12.6}/annet/annlib/netdev/views/__init__.py +0 -0
  43. {annet-0.12.4 → annet-0.12.6}/annet/annlib/netdev/views/dump.py +0 -0
  44. {annet-0.12.4 → annet-0.12.6}/annet/annlib/netdev/views/hardware.py +0 -0
  45. {annet-0.12.4 → annet-0.12.6}/annet/annlib/output.py +0 -0
  46. {annet-0.12.4 → annet-0.12.6}/annet/annlib/patching.py +0 -0
  47. {annet-0.12.4 → annet-0.12.6}/annet/annlib/rbparser/__init__.py +0 -0
  48. {annet-0.12.4 → annet-0.12.6}/annet/annlib/rbparser/acl.py +0 -0
  49. {annet-0.12.4 → annet-0.12.6}/annet/annlib/rbparser/deploying.py +0 -0
  50. {annet-0.12.4 → annet-0.12.6}/annet/annlib/rbparser/ordering.py +0 -0
  51. {annet-0.12.4 → annet-0.12.6}/annet/annlib/rbparser/platform.py +0 -0
  52. {annet-0.12.4 → annet-0.12.6}/annet/annlib/rbparser/syntax.py +0 -0
  53. {annet-0.12.4 → annet-0.12.6}/annet/annlib/rulebook/__init__.py +0 -0
  54. {annet-0.12.4 → annet-0.12.6}/annet/annlib/rulebook/common.py +0 -0
  55. {annet-0.12.4 → annet-0.12.6}/annet/annlib/tabparser.py +0 -0
  56. {annet-0.12.4 → annet-0.12.6}/annet/annlib/types.py +0 -0
  57. {annet-0.12.4 → annet-0.12.6}/annet/argparse.py +0 -0
  58. {annet-0.12.4 → annet-0.12.6}/annet/cli.py +0 -0
  59. {annet-0.12.4 → annet-0.12.6}/annet/cli_args.py +0 -0
  60. {annet-0.12.4 → annet-0.12.6}/annet/configs/context.yml +0 -0
  61. {annet-0.12.4 → annet-0.12.6}/annet/configs/logging.yaml +0 -0
  62. {annet-0.12.4 → annet-0.12.6}/annet/connectors.py +0 -0
  63. {annet-0.12.4 → annet-0.12.6}/annet/deploy.py +0 -0
  64. {annet-0.12.4 → annet-0.12.6}/annet/diff.py +0 -0
  65. {annet-0.12.4 → annet-0.12.6}/annet/executor.py +0 -0
  66. {annet-0.12.4 → annet-0.12.6}/annet/filtering.py +0 -0
  67. {annet-0.12.4 → annet-0.12.6}/annet/generators/__init__.py +0 -0
  68. {annet-0.12.4 → annet-0.12.6}/annet/generators/base.py +0 -0
  69. {annet-0.12.4 → annet-0.12.6}/annet/generators/common/__init__.py +0 -0
  70. {annet-0.12.4 → annet-0.12.6}/annet/generators/common/initial.py +0 -0
  71. {annet-0.12.4 → annet-0.12.6}/annet/generators/entire.py +0 -0
  72. {annet-0.12.4 → annet-0.12.6}/annet/generators/exceptions.py +0 -0
  73. {annet-0.12.4 → annet-0.12.6}/annet/generators/jsonfragment.py +0 -0
  74. {annet-0.12.4 → annet-0.12.6}/annet/generators/partial.py +0 -0
  75. {annet-0.12.4 → annet-0.12.6}/annet/generators/ref.py +0 -0
  76. {annet-0.12.4 → annet-0.12.6}/annet/generators/result.py +0 -0
  77. {annet-0.12.4 → annet-0.12.6}/annet/hardware.py +0 -0
  78. {annet-0.12.4 → annet-0.12.6}/annet/implicit.py +0 -0
  79. {annet-0.12.4 → annet-0.12.6}/annet/lib.py +0 -0
  80. {annet-0.12.4 → annet-0.12.6}/annet/output.py +0 -0
  81. {annet-0.12.4 → annet-0.12.6}/annet/parallel.py +0 -0
  82. {annet-0.12.4 → annet-0.12.6}/annet/patching.py +0 -0
  83. {annet-0.12.4 → annet-0.12.6}/annet/reference.py +0 -0
  84. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/__init__.py +0 -0
  85. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/arista/__init__.py +0 -0
  86. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/arista/iface.py +0 -0
  87. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/aruba/__init__.py +0 -0
  88. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/aruba/ap_env.py +0 -0
  89. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/aruba/misc.py +0 -0
  90. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/cisco/__init__.py +0 -0
  91. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/cisco/iface.py +0 -0
  92. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/cisco/misc.py +0 -0
  93. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/cisco/vlandb.py +0 -0
  94. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/common.py +0 -0
  95. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/deploying.py +0 -0
  96. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/huawei/__init__.py +0 -0
  97. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/huawei/aaa.py +0 -0
  98. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/huawei/bgp.py +0 -0
  99. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/huawei/iface.py +0 -0
  100. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/huawei/misc.py +0 -0
  101. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/huawei/vlandb.py +0 -0
  102. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/juniper/__init__.py +0 -0
  103. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/nexus/__init__.py +0 -0
  104. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/nexus/iface.py +0 -0
  105. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/patching.py +0 -0
  106. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/ribbon/__init__.py +0 -0
  107. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/arista.deploy +0 -0
  108. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/arista.order +0 -0
  109. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/arista.rul +0 -0
  110. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/aruba.deploy +0 -0
  111. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/aruba.order +0 -0
  112. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/aruba.rul +0 -0
  113. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/cisco.deploy +0 -0
  114. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/cisco.order +0 -0
  115. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/cisco.rul +0 -0
  116. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/huawei.deploy +0 -0
  117. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/huawei.order +0 -0
  118. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/huawei.rul +0 -0
  119. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/juniper.rul +0 -0
  120. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/nexus.deploy +0 -0
  121. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/nexus.order +0 -0
  122. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/nexus.rul +0 -0
  123. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/nokia.rul +0 -0
  124. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/pc.order +0 -0
  125. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/pc.rul +0 -0
  126. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/ribbon.deploy +0 -0
  127. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/ribbon.rul +0 -0
  128. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/routeros.order +0 -0
  129. {annet-0.12.4 → annet-0.12.6}/annet/rulebook/texts/routeros.rul +0 -0
  130. {annet-0.12.4 → annet-0.12.6}/annet/storage.py +0 -0
  131. {annet-0.12.4 → annet-0.12.6}/annet/tabparser.py +0 -0
  132. {annet-0.12.4 → annet-0.12.6}/annet/text_term_format.py +0 -0
  133. {annet-0.12.4 → annet-0.12.6}/annet/tracing.py +0 -0
  134. {annet-0.12.4 → annet-0.12.6}/annet.egg-info/SOURCES.txt +0 -0
  135. {annet-0.12.4 → annet-0.12.6}/annet.egg-info/dependency_links.txt +0 -0
  136. {annet-0.12.4 → annet-0.12.6}/annet.egg-info/entry_points.txt +0 -0
  137. {annet-0.12.4 → annet-0.12.6}/annet.egg-info/requires.txt +0 -0
  138. {annet-0.12.4 → annet-0.12.6}/annet.egg-info/top_level.txt +0 -0
  139. {annet-0.12.4 → annet-0.12.6}/annet_generators/__init__.py +0 -0
  140. {annet-0.12.4 → annet-0.12.6}/annet_generators/example/__init__.py +0 -0
  141. {annet-0.12.4 → annet-0.12.6}/annet_generators/example/lldp.py +0 -0
  142. {annet-0.12.4 → annet-0.12.6}/requirements.txt +0 -0
  143. {annet-0.12.4 → annet-0.12.6}/setup.cfg +0 -0
  144. {annet-0.12.4 → annet-0.12.6}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: annet
3
- Version: 0.12.4
3
+ Version: 0.12.6
4
4
  Summary: annet
5
5
  Home-page: https://github.com/annetutil/annet
6
6
  License: MIT
@@ -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
  # =====
@@ -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()
@@ -833,22 +837,29 @@ class Loader:
833
837
  use_mesh=not self._args.no_mesh,
834
838
  preload_extra_fields=True,
835
839
  )
840
+
836
841
  for device in devices:
837
842
  self._devices_map[device.id] = device
843
+
838
844
  self._gens.update(_old_resolve_gens(self._args, storage, devices))
839
845
  if not devices and not self._no_empty_warning:
840
846
  get_logger().error("No devices found for %s", self._args.query)
841
847
  return
842
848
 
843
849
  @property
844
- def device_fqdns(self):
850
+ def device_fqdns(self) -> Dict[Any, str]:
845
851
  return {
846
852
  device_id: d.fqdn
847
853
  for device_id, d in self._devices_map.items()
848
854
  }
849
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
+
850
861
  @property
851
- def device_ids(self):
862
+ def device_ids(self) -> List[Any]:
852
863
  return list(self._devices_map)
853
864
 
854
865
  @property
@@ -57,6 +57,7 @@ class GeneratorPerfMesurer:
57
57
  exc_tb=None) -> GeneratorPerf:
58
58
  total = time.monotonic() - self._start_time
59
59
  self._span_ctx.__exit__(exc_type, exc_val, exc_tb)
60
+ rt = self._gen.storage.flush_perf()
60
61
 
61
62
  meta = {}
62
63
  if tracing_connector.get().enabled:
@@ -68,7 +69,7 @@ class GeneratorPerfMesurer:
68
69
  },
69
70
  }
70
71
 
71
- self.last_result = GeneratorPerf(total=total, rt=total, meta=meta)
72
+ self.last_result = GeneratorPerf(total=total, rt=rt, meta=meta)
72
73
  return self.last_result
73
74
 
74
75
  def __enter__(self):
@@ -25,7 +25,12 @@ class GeneratorPerf:
25
25
  Рантайм статистика времени выполнения генератора
26
26
  """
27
27
 
28
- def __init__(self, total: float, rt: float, meta: Optional[Dict[str, Any]] = None):
28
+ def __init__(
29
+ self,
30
+ total: float,
31
+ rt: Optional[Dict[str, List[Dict[str, Any]]]],
32
+ meta: Optional[Dict[str, Any]] = None
33
+ ):
29
34
  self.total = total
30
35
  self.rt = rt
31
36
  self._meta = meta
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: annet
3
- Version: 0.12.4
3
+ Version: 0.12.6
4
4
  Summary: annet
5
5
  Home-page: https://github.com/annetutil/annet
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes