Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

find-host command #60

Merged
merged 4 commits into from
Jan 17, 2022
Merged

find-host command #60

merged 4 commits into from
Jan 17, 2022

Conversation

pke11y
Copy link
Contributor

@pke11y pke11y commented Jan 11, 2022

This PR adds a new command to find a host in the inventory table. The use case was outlined by IP Fabric.

Current filters are ip and mac validated using netutils.

Copy link
Contributor

@chadell chadell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my only concern is on the "fors" question, the rest looks ok

nautobot_chatops_ipfabric/ipfabric.py Show resolved Hide resolved
nautobot_chatops_ipfabric/ipfabric.py Outdated Show resolved Hide resolved
nautobot_chatops_ipfabric/ipfabric.py Outdated Show resolved Hide resolved
for host in hosts:
for edge in host.get("edges"):
edge_details = " ".join([edge.get("hostname", ""), edge.get("intName", "")])
host["edges"] = edge_details
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused by these fors. It looks like we can get multiple edges and gateways, but we only store the last?? 🤔
I guess I'm missing something here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all the data I have only one object is ever returned for these attributes. Will update to account for possible other elements.

nautobot_chatops_ipfabric/worker.py Outdated Show resolved Hide resolved
Copy link
Contributor

@chadell chadell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pke11y pke11y merged commit 78ba695 into develop Jan 17, 2022
@pke11y pke11y deleted the pk-find-host branch February 10, 2022 16:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants