Skip to content

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

3 participants