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

Specifying same device with different names in the inventory won't raise an error #818

Open
mtache opened this issue Sep 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mtache
Copy link
Collaborator

mtache commented Sep 6, 2024

AntaDevice equality is based on (host, port) tuple (https://github.com/aristanetworks/anta/blob/main/anta/device.py#L302).

However, we accept that the user specifies multiple identical devices (same (host, port) tuple) with the different names, leading to inconsistent output:

Inventory:

anta_inventory:
  hosts:
  - host: localhost
    name: spine1
  - host: localhost
    name: spine2
  - host: localhost
    name: leaf1a
  - host: localhost
    name: leaf1b
  - host: localhost
    name: leaf2a
  - host: localhost
    name: leaf2b

Logs:

--- ANTA NRFU Run Information ---
Number of devices: 6 (6 established)
Total number of selected tests: 738
Maximum number of open file descriptors for the current ANTA process: 16384
---------------------------------
Running ANTA tests completed in: 0:00:00.322.
Cache statistics for 'spine1': 168 hits / 228 command(s) (73.68%) <<<<<<<<<<<< all commands are run on the same device
Cache statistics for 'spine2': 0 hits / 0 command(s) (0.00%)
Cache statistics for 'leaf1a': 0 hits / 0 command(s) (0.00%)
Cache statistics for 'leaf1b': 0 hits / 0 command(s) (0.00%)
Cache statistics for 'leaf2a': 0 hits / 0 command(s) (0.00%)
Cache statistics for 'leaf2b': 0 hits / 0 command(s) (0.00%)
@mtache mtache added the bug Something isn't working label Sep 6, 2024
@gmuloc gmuloc added this to the v1.1.0 milestone Sep 6, 2024
@mtache mtache self-assigned this Sep 9, 2024
@mtache
Copy link
Collaborator Author

mtache commented Sep 9, 2024

As discussed, this use case is not supported.
We should raise an error if the user specifies the same device with different names in the inventory.

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

No branches or pull requests

2 participants