Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anta fails to load inventory #460

Closed
dwarf-fr opened this issue Nov 15, 2023 · 0 comments · Fixed by #462
Closed

Anta fails to load inventory #460

dwarf-fr opened this issue Nov 15, 2023 · 0 comments · Fixed by #462
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dwarf-fr
Copy link

When running anti in ATD with the following catalog, anta generates a traceback

Inventory

---
anta_inventory:
  hosts:
  - host: 192.168.0.10
    name: s1-spine1
  - host: 192.168.0.11
    name: s1-spine2
  - host: 192.168.0.12
    name: s1-leaf1
  - host: 192.168.0.13
    name: s1-leaf2
  - host: 192.168.0.14
    name: s1-leaf3
  - host: 192.168.0.15
    name: s1-leaf4

traceback

anta -i network-tests/demo.yml nrfu -c TestMalaga.yml table
Traceback (most recent call last):
  File "/home/coder/.local/bin/anta", line 8, in <module>
    sys.exit(cli())
  File "/home/coder/.local/lib/python3.9/site-packages/anta/cli/__init__.py", line 206, in cli
    anta(obj={}, auto_envvar_prefix="ANTA")  # pragma: no cover
  File "/home/coder/.local/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/coder/.local/lib/python3.9/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/coder/.local/lib/python3.9/site-packages/click/core.py", line 1686, in invoke
    sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
  File "/home/coder/.local/lib/python3.9/site-packages/click/core.py", line 943, in make_context
    self.parse_args(ctx, args)
  File "/home/coder/.local/lib/python3.9/site-packages/anta/cli/utils.py", line 154, in parse_args
    return super().parse_args(ctx, args)
  File "/home/coder/.local/lib/python3.9/site-packages/click/core.py", line 1644, in parse_args
    rest = super().parse_args(ctx, args)
  File "/home/coder/.local/lib/python3.9/site-packages/click/core.py", line 1408, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/home/coder/.local/lib/python3.9/site-packages/click/core.py", line 2400, in handle_parse_result
    value = self.process_value(ctx, value)
  File "/home/coder/.local/lib/python3.9/site-packages/click/core.py", line 2362, in process_value
    value = self.callback(ctx, self, value)
  File "/home/coder/.local/lib/python3.9/site-packages/anta/cli/utils.py", line 96, in parse_catalog
    catalog: AntaCatalog = AntaCatalog.parse(value)
  File "/home/coder/.local/lib/python3.9/site-packages/anta/catalog.py", line 226, in parse
    catalog_data = AntaCatalogFile(**data)
TypeError: anta.catalog.AntaCatalogFile() argument after ** must be a mapping, not str
@gmuloc gmuloc self-assigned this Nov 15, 2023
@gmuloc gmuloc added this to the v1.0.0 milestone Nov 15, 2023
@gmuloc gmuloc added the bug Something isn't working label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants