annet 0.14.0__py3-none-any.whl → 0.14.2__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.

@@ -204,7 +204,7 @@ class NetboxStorageV37(Storage):
204
204
  res = extend_device(
205
205
  device=device,
206
206
  storage=self,
207
- interfaces=interfaces[device.id],
207
+ interfaces=interfaces,
208
208
  neighbours=neighbours,
209
209
  )
210
210
  return res
annet/annlib/jsontools.py CHANGED
@@ -28,7 +28,15 @@ def apply_json_fragment(
28
28
  try:
29
29
  new_value = pointer.get(new_fragment)
30
30
  except jsonpointer.JsonPointerException:
31
- # no value found in new_fragment by the pointer, skip the ACL item
31
+ # no value found in new_fragment by the pointer,
32
+ # try to delete it from the new config
33
+ try:
34
+ doc, part = pointer.to_last(full_new_config)
35
+ if isinstance(doc, dict) and isinstance(part, str):
36
+ doc.pop(part, None)
37
+ except jsonpointer.JsonPointerException:
38
+ # not found in the old config either
39
+ pass
32
40
  continue
33
41
 
34
42
  _ensure_pointer_exists(full_new_config, pointer)
@@ -105,12 +105,17 @@ class RunGeneratorResult:
105
105
  new_fragment,
106
106
  result_acl,
107
107
  )
108
- if filepath in reload_prios and \
109
- reload_prios[filepath] > generator_result.reload_prio:
108
+ if jsontools.format_json(new_config) == jsontools.format_json(previous_config):
109
+ # config is not changed, deprioritize reload_cmd
110
+ reload_prio = 0
111
+ else:
112
+ reload_prio = generator_result.reload_prio
113
+
114
+ if filepath in reload_prios and reload_prios[filepath] > reload_prio:
110
115
  _, reload_cmd = files[filepath]
111
116
  else:
112
117
  reload_cmd = generator_result.reload
113
- reload_prios[filepath] = generator_result.reload_prio
118
+ reload_prios[filepath] = reload_prio
114
119
  files[filepath] = (new_config, reload_cmd)
115
120
  return files
116
121
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: annet
3
- Version: 0.14.0
3
+ Version: 0.14.2
4
4
  Summary: annet
5
5
  Home-page: https://github.com/annetutil/annet
6
6
  License: MIT
@@ -34,13 +34,13 @@ annet/adapters/netbox/common/storage_opts.py,sha256=rl_0pr3VzmOy6PDZIUMkKSBfJh90
34
34
  annet/adapters/netbox/v24/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  annet/adapters/netbox/v24/storage.py,sha256=ogCu5XXIpcpPtuz7dWfDFIbqtz8k5G96PL6mhAQWwBU,6026
36
36
  annet/adapters/netbox/v37/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
- annet/adapters/netbox/v37/storage.py,sha256=XIP11yp_ypi2lEQdtqNXGkzUYNxFCfDsmUM5pnoMFPU,7496
37
+ annet/adapters/netbox/v37/storage.py,sha256=3Xv4BoStxy80iev4B9WMxUxl_U0LdKG6ZoTykMpliLw,7485
38
38
  annet/annlib/__init__.py,sha256=fT1l4xV5fqqg8HPw9HqmZVN2qwS8i6X1aIm2zGDjxKY,252
39
39
  annet/annlib/command.py,sha256=uuBddMQphtn8P5MO5kzIa8_QrtMns-k05VeKv1bcAuA,1043
40
40
  annet/annlib/diff.py,sha256=UPt3kYFQdQdVVy3ePYzNHPAxMVmHxCrCnZnMCV6ou2Q,4587
41
41
  annet/annlib/errors.py,sha256=jBcSFzY6Vj-FxR__vqjFm-87AwYQ0xHuAopTirii5AU,287
42
42
  annet/annlib/filter_acl.py,sha256=0w1VF6WcONiTYTQh0yWi6_j9rCTc_kMLAUMr0hbdkNU,7203
43
- annet/annlib/jsontools.py,sha256=UXZrO6RZ4LIcJkQ6xUcef6WuHMgpMTipolcIBZTEhuc,3461
43
+ annet/annlib/jsontools.py,sha256=J_pToAAXQphP1QFh6uLQH9PnmHO68I5WV64qIQXLeDQ,3807
44
44
  annet/annlib/lib.py,sha256=eJ4hcVuQ6pdYBzLs4YKCHFtq45idOfZCYp92XfF7_QI,15317
45
45
  annet/annlib/output.py,sha256=_SjJ6G6bejvnTKqNHw6xeio0FT9oO3OIkLaOC3cEga4,7569
46
46
  annet/annlib/patching.py,sha256=GwG2lT4w-I1Ls3Eswn6SPJLBUVt2M3Ysw1fmXsWamYw,19793
@@ -72,7 +72,7 @@ annet/generators/jsonfragment.py,sha256=itHDq46B50o2-zxnEtCAPb8XKyc0-ozTe-E_Mjpk
72
72
  annet/generators/partial.py,sha256=XI01KDA--XwjSEU33SOQCCJZRXFq5boRz1uJA8lVA1g,3502
73
73
  annet/generators/perf.py,sha256=K72ivUuXbNXrsHrLeKWhGmczGYWsB7kUDdDzqOX6j3c,2370
74
74
  annet/generators/ref.py,sha256=QVdeL8po1D0kBsVLOpCjFR81D8yNTk-kaQj5WUM4hng,438
75
- annet/generators/result.py,sha256=boMG4mwvitBLlHdPM8rPOqlKPrrNAqdV6NAM9wwIZHc,4765
75
+ annet/generators/result.py,sha256=zMAvGOYQU803bGy6datZduHLgrEqK2Zba_Jcf9Qn9p0,4976
76
76
  annet/generators/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
77
77
  annet/generators/common/initial.py,sha256=qYBxXFhyOPy34cxc6hsIXseod-lYCmmbuNHpM0uteY0,1244
78
78
  annet/rulebook/__init__.py,sha256=14IpOfTbeJtre7JKrfXVYiH0qAXsUSOL7AatUFmSQs0,3847
@@ -124,10 +124,10 @@ annet/rulebook/texts/routeros.rul,sha256=ipfxjj0mjFef6IsUlupqx4BY_Je_OUb8u_U1019
124
124
  annet_generators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
125
125
  annet_generators/example/__init__.py,sha256=zVd8_DrXuOASrNzg2Ab94rPyvJff83L-_HppDFxnUjM,228
126
126
  annet_generators/example/lldp.py,sha256=68CLrK7vxTQQy9XIBxtywuEdBNlIlfXGYj8_wYWs5UI,1146
127
- annet-0.14.0.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
128
- annet-0.14.0.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
129
- annet-0.14.0.dist-info/METADATA,sha256=Lv2Cas7DjTkxzl76rnYaFgBaBHLWwnZvMYGTIdFJ1-E,694
130
- annet-0.14.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
131
- annet-0.14.0.dist-info/entry_points.txt,sha256=yHimujIzR2bwNIbb--MTs_GpXiAve89Egpu2LlgTEkg,119
132
- annet-0.14.0.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
133
- annet-0.14.0.dist-info/RECORD,,
127
+ annet-0.14.2.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
128
+ annet-0.14.2.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
129
+ annet-0.14.2.dist-info/METADATA,sha256=WppaQMqrD_L10G0ym4DUhuDiP99dhiCUKFArA_f7ynE,694
130
+ annet-0.14.2.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
131
+ annet-0.14.2.dist-info/entry_points.txt,sha256=yHimujIzR2bwNIbb--MTs_GpXiAve89Egpu2LlgTEkg,119
132
+ annet-0.14.2.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
133
+ annet-0.14.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.2.0)
2
+ Generator: setuptools (70.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5