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

Add ability to add groups to Inventory Element & Hosts at runtime. #590

Closed
wants to merge 24 commits into from

Conversation

kpeterson-sf
Copy link
Contributor

@kpeterson-sf kpeterson-sf commented Sep 22, 2020

Update inventory to allow for the addition of groups to an Inventory Element at run time.

Added two methods to the InventoryElement: add() & remove()

Added two methods to Host: add_to_group() and remove_from_group()

Closes #430

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

Excellent PR, a few things have change in nornir3 making some of the comments in the issue obsolete (sorry about that) but I think the add method you proposed and the test you added are excellent ideas. Thanks!

:param group: Group object to remove
:return: None
"""
super().remove(group)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this means the method isn't really necessary as we get the same behaviour without it, right? Or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah don't see any reason it needs to stay there.

@dbarrosop
Copy link
Contributor

apologies this is taking so long...

@dbarrosop
Copy link
Contributor

dbarrosop commented Dec 27, 2020

Closed in favor of #624

Thanks!

@dbarrosop dbarrosop closed this Dec 27, 2020
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.

Assigning host to group during runtime
2 participants