annet 0.16.20__py3-none-any.whl → 0.16.21__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/annlib/tabparser.py CHANGED
@@ -330,6 +330,17 @@ class CiscoFormatter(BlockExitFormatter):
330
330
  yield from super().block_exit(context)
331
331
 
332
332
 
333
+ class AristaFormatter(CiscoFormatter):
334
+
335
+ def block_exit(self, context: Optional[FormatterContext]) -> str:
336
+ current = context and context.row or ""
337
+
338
+ if current.startswith(("address-family")):
339
+ yield from block_wrapper("exit")
340
+ else:
341
+ yield from super().block_exit(context)
342
+
343
+
333
344
  class AsrFormatter(BlockExitFormatter):
334
345
  def __init__(self, indent=" "):
335
346
  super().__init__("exit", indent)
@@ -705,7 +716,7 @@ def make_formatter(vendor, **kwargs):
705
716
  "nexus": CiscoFormatter,
706
717
  "huawei": HuaweiFormatter,
707
718
  "optixtrans": OptixtransFormatter,
708
- "arista": CiscoFormatter,
719
+ "arista": AristaFormatter,
709
720
  "nokia": NokiaFormatter,
710
721
  "routeros": RosFormatter,
711
722
  "aruba": CiscoFormatter,
annet/tabparser.py CHANGED
@@ -11,6 +11,7 @@ from annet.annlib.tabparser import ( # pylint: disable=unused-import
11
11
  RibbonFormatter,
12
12
  RosFormatter,
13
13
  parse_to_tree,
14
+ AristaFormatter,
14
15
  )
15
16
 
16
17
 
@@ -21,7 +22,7 @@ def make_formatter(hw, **kwargs):
21
22
  cls = HuaweiFormatter
22
23
  elif hw.Cisco.ASR or hw.Cisco.XRV:
23
24
  cls = AsrFormatter
24
- elif hw.Nexus or hw.Cisco or hw.Arista or hw.Aruba or hw.B4com:
25
+ elif hw.Nexus or hw.Cisco or hw.Aruba or hw.B4com:
25
26
  cls = CiscoFormatter
26
27
  elif hw.Juniper:
27
28
  cls = JuniperFormatter
@@ -35,6 +36,8 @@ def make_formatter(hw, **kwargs):
35
36
  cls = RibbonFormatter
36
37
  elif hw.H3C:
37
38
  cls = HuaweiFormatter
39
+ elif hw.Arista:
40
+ cls = AristaFormatter
38
41
  else:
39
42
  raise NotImplementedError("Unknown formatter for hw '%s'" % hw)
40
43
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: annet
3
- Version: 0.16.20
3
+ Version: 0.16.21
4
4
  Summary: annet
5
5
  Home-page: https://github.com/annetutil/annet
6
6
  License: MIT
@@ -18,7 +18,7 @@ annet/parallel.py,sha256=hLkzEht0KhzmzUWDdO4QFYQHzhxs3wPlTA8DxbB2ziw,17160
18
18
  annet/patching.py,sha256=nILbY5oJajN0b1j3f0HEJm05H3HVThnWvB7vDVh7UQw,559
19
19
  annet/reference.py,sha256=B8mH8VUMcecPnzULiTVb_kTQ7jQrCL7zp4pfIZQa5fk,4035
20
20
  annet/storage.py,sha256=eAHEvPbRuKDUJdnkzSrHmW_lBJS3Y0g93Y2VJ4qzifQ,3941
21
- annet/tabparser.py,sha256=hf-_9R14C-_Q17lxUqbyT377QkrKhJLnaL-cG_YpUIQ,1016
21
+ annet/tabparser.py,sha256=yBB7j2DAaFYTK6C9rkgT-7pZhyTtJibdQqpK1J5JClA,1074
22
22
  annet/text_term_format.py,sha256=CHb6viv45vmYl-SK1A1vyPHGhaEni6jVybBusaQnct8,2813
23
23
  annet/tracing.py,sha256=ndpM-au1c88uBBpOuH_z52qWZL773edYozNyys_wA68,4044
24
24
  annet/types.py,sha256=f2HwqoKa6AucwFwDMszoouB6m1B8n6VmdjHMktO30Kc,7175
@@ -50,7 +50,7 @@ annet/annlib/jsontools.py,sha256=DVmA6kmKGSCsKrFnag4EMR1WKe39Owlvzpfdo726ufk,547
50
50
  annet/annlib/lib.py,sha256=eJ4hcVuQ6pdYBzLs4YKCHFtq45idOfZCYp92XfF7_QI,15317
51
51
  annet/annlib/output.py,sha256=_SjJ6G6bejvnTKqNHw6xeio0FT9oO3OIkLaOC3cEga4,7569
52
52
  annet/annlib/patching.py,sha256=2CpAT3T43IUFJR57qTYSwjQ0smg0uHWN43df4n1WArs,19937
53
- annet/annlib/tabparser.py,sha256=OrRAkXv0vb0erZ3YLM2_LzoOo-A8qXTnaTHHyI1WYKY,28175
53
+ annet/annlib/tabparser.py,sha256=zFTvs0jQ_hIghUz0rv_tGFWWDOQNXy0uqaWuuG_hCVU,28498
54
54
  annet/annlib/types.py,sha256=VHU0CBADfYmO0xzB_c5f-mcuU3dUumuJczQnqGlib9M,852
55
55
  annet/annlib/netdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
56
  annet/annlib/netdev/db.py,sha256=fI_u5aya4l61mbYSjj4JwlVfi3s7obt2jqERSuXGRUI,1634
@@ -164,10 +164,10 @@ annet_generators/rpl_example/__init__.py,sha256=z4-gsDv06BBpgTwRohc50VBQYFD26QVu
164
164
  annet_generators/rpl_example/items.py,sha256=6x7b0wZ7Vjn6yCaJ-aGbpTHm7fyqO77b-LRqzzhEbh4,615
165
165
  annet_generators/rpl_example/policy_generator.py,sha256=KFCqn347CIPcnllOHfINYeKgNSr6Wl-bdM5Xj_YKhYM,11183
166
166
  annet_generators/rpl_example/route_policy.py,sha256=QjxFjkePHfTo2CpMeRVaDqZXNXLM-gGlE8EocHuOR4Y,1189
167
- annet-0.16.20.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
168
- annet-0.16.20.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
169
- annet-0.16.20.dist-info/METADATA,sha256=Pd3UDfkQof5iuNlBbyrZrXmZYHEIuSNJzcimOVLIbRw,728
170
- annet-0.16.20.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
171
- annet-0.16.20.dist-info/entry_points.txt,sha256=5lIaDGlGi3l6QQ2ry2jZaqViP5Lvt8AmsegdD0Uznck,192
172
- annet-0.16.20.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
173
- annet-0.16.20.dist-info/RECORD,,
167
+ annet-0.16.21.dist-info/AUTHORS,sha256=rh3w5P6gEgqmuC-bw-HB68vBCr-yIBFhVL0PG4hguLs,878
168
+ annet-0.16.21.dist-info/LICENSE,sha256=yPxl7dno02Pw7gAcFPIFONzx_gapwDoPXsIsh6Y7lC0,1079
169
+ annet-0.16.21.dist-info/METADATA,sha256=YCEUyxxd8Xc5Dv-HcW5YxYRCLtptSN9PHNKaP-HpDvc,728
170
+ annet-0.16.21.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
171
+ annet-0.16.21.dist-info/entry_points.txt,sha256=5lIaDGlGi3l6QQ2ry2jZaqViP5Lvt8AmsegdD0Uznck,192
172
+ annet-0.16.21.dist-info/top_level.txt,sha256=QsoTZBsUtwp_FEcmRwuN8QITBmLOZFqjssRfKilGbP8,23
173
+ annet-0.16.21.dist-info/RECORD,,