annet 0.12.5__py3-none-any.whl → 0.12.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/api/__init__.py +2 -3
- annet/gen.py +14 -6
- annet/generators/__init__.py +1 -1
- annet/generators/common/initial.py +2 -2
- {annet-0.12.5.dist-info → annet-0.12.7.dist-info}/METADATA +1 -1
- {annet-0.12.5.dist-info → annet-0.12.7.dist-info}/RECORD +11 -11
- {annet-0.12.5.dist-info → annet-0.12.7.dist-info}/AUTHORS +0 -0
- {annet-0.12.5.dist-info → annet-0.12.7.dist-info}/LICENSE +0 -0
- {annet-0.12.5.dist-info → annet-0.12.7.dist-info}/WHEEL +0 -0
- {annet-0.12.5.dist-info → annet-0.12.7.dist-info}/entry_points.txt +0 -0
- {annet-0.12.5.dist-info → annet-0.12.7.dist-info}/top_level.txt +0 -0
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
|
-
|
|
225
|
-
|
|
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
|
-
|
|
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)
|
|
@@ -705,8 +709,7 @@ def _old_new_get_config_cli(ctx: OldNewDeviceContext, device: Device) -> str:
|
|
|
705
709
|
elif ctx.config == "running":
|
|
706
710
|
text = ctx.running.get(device)
|
|
707
711
|
if text is None:
|
|
708
|
-
exc = (ctx.failed_running.get(device
|
|
709
|
-
ctx.failed_running.get(device.hostname) or
|
|
712
|
+
exc = (ctx.failed_running.get(device) or
|
|
710
713
|
Exception("I can't get device config and I don't know why"))
|
|
711
714
|
get_logger(host=device.hostname).error("config error %s", exc)
|
|
712
715
|
raise exc
|
|
@@ -819,7 +822,7 @@ class Loader:
|
|
|
819
822
|
self._args = args
|
|
820
823
|
self._storages = storages
|
|
821
824
|
self._no_empty_warning = no_empty_warning
|
|
822
|
-
self._devices_map: Dict[
|
|
825
|
+
self._devices_map: Dict[Any, Device] = {}
|
|
823
826
|
self._gens: DeviceGenerators = DeviceGenerators()
|
|
824
827
|
|
|
825
828
|
self._preload()
|
|
@@ -843,14 +846,19 @@ class Loader:
|
|
|
843
846
|
return
|
|
844
847
|
|
|
845
848
|
@property
|
|
846
|
-
def device_fqdns(self):
|
|
849
|
+
def device_fqdns(self) -> Dict[Any, str]:
|
|
847
850
|
return {
|
|
848
851
|
device_id: d.fqdn
|
|
849
852
|
for device_id, d in self._devices_map.items()
|
|
850
853
|
}
|
|
851
854
|
|
|
855
|
+
def get_device(self, device_id: Any) -> Device:
|
|
856
|
+
if device_id not in self._devices_map:
|
|
857
|
+
raise KeyError(f"Unknown device with id {device_id}")
|
|
858
|
+
return self._devices_map[device_id]
|
|
859
|
+
|
|
852
860
|
@property
|
|
853
|
-
def device_ids(self):
|
|
861
|
+
def device_ids(self) -> List[Any]:
|
|
854
862
|
return list(self._devices_map)
|
|
855
863
|
|
|
856
864
|
@property
|
annet/generators/__init__.py
CHANGED
|
@@ -120,7 +120,7 @@ def run_partial_initial(device):
|
|
|
120
120
|
tracing_connector.get().set_device_attributes(tracing_connector.get().get_current_span(), device)
|
|
121
121
|
|
|
122
122
|
run_args = GeneratorPartialRunArgs(device)
|
|
123
|
-
return run_partial_generators([InitialConfig(storage=device.storage)], [], run_args)
|
|
123
|
+
return run_partial_generators([InitialConfig(storage=device.storage, do_run=True)], [], run_args)
|
|
124
124
|
|
|
125
125
|
|
|
126
126
|
@tracing.function
|
|
@@ -12,9 +12,9 @@ class InitialConfig(PartialGenerator):
|
|
|
12
12
|
Acl для данного генератора не нужен, он будет генерировать
|
|
13
13
|
конфиг целиком.
|
|
14
14
|
"""
|
|
15
|
-
def __init__(self, storage=
|
|
16
|
-
self._do_run = not storage
|
|
15
|
+
def __init__(self, storage, do_run: bool = False):
|
|
17
16
|
super().__init__(storage=storage)
|
|
17
|
+
self._do_run = do_run
|
|
18
18
|
|
|
19
19
|
def run_huawei(self, device):
|
|
20
20
|
if not self._do_run:
|
|
@@ -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=
|
|
11
|
+
annet/gen.py,sha256=aVq2QkOG42KvHzSMKpiPXP7Awp8naVViqp46fz2IuwI,32795
|
|
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,10 +65,10 @@ 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=
|
|
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
|
-
annet/generators/__init__.py,sha256=
|
|
71
|
+
annet/generators/__init__.py,sha256=tk20umBuMEcd8QKET3mxJQsDj-dvjlwGnrlgTw0wbRY,15622
|
|
72
72
|
annet/generators/base.py,sha256=rgQLcQBPZm4ecbKmRhVOpBR-GFJAiVfdb_y5f2-LUR8,3670
|
|
73
73
|
annet/generators/entire.py,sha256=7WySkVaXNT3ZAiHcQ0JUKdlhGJAN8cNUxF6c7ilYnO8,2928
|
|
74
74
|
annet/generators/exceptions.py,sha256=GPXTBgn2xZ3Ev_bdOPlfCLGRC1kQHe_dEq88S-uyi5s,151
|
|
@@ -78,7 +78,7 @@ annet/generators/perf.py,sha256=K72ivUuXbNXrsHrLeKWhGmczGYWsB7kUDdDzqOX6j3c,2370
|
|
|
78
78
|
annet/generators/ref.py,sha256=QVdeL8po1D0kBsVLOpCjFR81D8yNTk-kaQj5WUM4hng,438
|
|
79
79
|
annet/generators/result.py,sha256=boMG4mwvitBLlHdPM8rPOqlKPrrNAqdV6NAM9wwIZHc,4765
|
|
80
80
|
annet/generators/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
81
|
-
annet/generators/common/initial.py,sha256=
|
|
81
|
+
annet/generators/common/initial.py,sha256=qYBxXFhyOPy34cxc6hsIXseod-lYCmmbuNHpM0uteY0,1244
|
|
82
82
|
annet/rulebook/__init__.py,sha256=14IpOfTbeJtre7JKrfXVYiH0qAXsUSOL7AatUFmSQs0,3847
|
|
83
83
|
annet/rulebook/common.py,sha256=zK1s2c5lc5HQbIlMUQ4HARQudXSgOYiZ_Sxc2I_tHqg,721
|
|
84
84
|
annet/rulebook/deploying.py,sha256=XV0XQvc3YvwM8SOgOQlc-fCW4bnjQg_1CTZkTwMp14A,2972
|
|
@@ -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.
|
|
132
|
-
annet-0.12.
|
|
133
|
-
annet-0.12.
|
|
134
|
-
annet-0.12.
|
|
135
|
-
annet-0.12.
|
|
136
|
-
annet-0.12.
|
|
137
|
-
annet-0.12.
|
|
131
|
+
annet-0.12.7.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
|
|
132
|
+
annet-0.12.7.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
|
|
133
|
+
annet-0.12.7.dist-info/METADATA,sha256=_zMFNJ1-PhNI0li0_MMPpsy25mkJ-ZwBHbGeMJQOha4,694
|
|
134
|
+
annet-0.12.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
135
|
+
annet-0.12.7.dist-info/entry_points.txt,sha256=yHimujIzR2bwNIbb--MTs_GpXiAve89Egpu2LlgTEkg,119
|
|
136
|
+
annet-0.12.7.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
|
|
137
|
+
annet-0.12.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|