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

Added functions to retrieve inventory using native datastructures #375

Merged
merged 12 commits into from
Apr 22, 2019
Merged

Added functions to retrieve inventory using native datastructures #375

merged 12 commits into from
Apr 22, 2019

Conversation

brandomando
Copy link
Contributor

Adding functions to nornir.core.inventory.Inventory to abstract serialization of the running inventory into dictionaries. Functions for: full inventory, defaults, groups, and hosts. This makes the inventory available in an exportable format that users could then build plugins to push out into various formats.

A simple future usecase would be to leverage the dicts to export to simple inventory files. This would allow dynamically added inventory items to be captured and placed into a more permanent inventory.

nornir/core/inventory.py Outdated Show resolved Hide resolved
nornir/core/inventory.py Outdated Show resolved Hide resolved
nornir/core/inventory.py Outdated Show resolved Hide resolved
@dbarrosop
Copy link
Contributor

Looks good, just a few minor comments to make the code more efficient.

@brandomando
Copy link
Contributor Author

@dbarrosop , I believe I have addressed your changes. Let me know if there's anything else.

Thanks

@dbarrosop
Copy link
Contributor

Awesome!

@dbarrosop dbarrosop merged commit fa15294 into nornir-automation:develop Apr 22, 2019
@dbarrosop dbarrosop changed the title Get inventory dicts Added functions to retrieve inventory using native datastructures Apr 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants