Skip to content

670 - Add extra branching support to pynetbox #686

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

Merged
merged 7 commits into from
May 20, 2025
Merged

670 - Add extra branching support to pynetbox #686

merged 7 commits into from
May 20, 2025

Conversation

arthanson
Copy link
Collaborator

Fixes: #670

creates an activate_branch function that is a context manager to use different branches. Adds documentation to optionally use tenacity library for waiting, incremental backoff, etc.. to define a wait_for_branch_status function to aid script authors.

@arthanson arthanson requested a review from jnovinger May 16, 2025 20:13
@arthanson arthanson marked this pull request as ready for review May 16, 2025 20:13
jnovinger
jnovinger previously approved these changes May 19, 2025
... sites = nb.dcim.sites.all()
... # All operations within this block will use the branch's schema
"""
if not isinstance(branch, Record) or not "schema_id" in dict(branch):
Copy link
Member

Choose a reason for hiding this comment

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

I was going to ask if this isinstance() check could be more explicit, but I don't think it can be without creating a model for netbox_branching objects in pynetbox, right?

@arthanson arthanson merged commit 82e0227 into master May 20, 2025
9 checks passed
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.

Add a built-in function to create and activate a Branch
2 participants