Skip to content
Discussion options

You must be logged in to vote

get_first_available_ip will give you the first IP address that doesn't exist within that prefix, i.e. does not overlap any existing IP address or range object. See source here. There's no point in the code checking the status, because addresses with any status are already skipped; it only returns an address where there is no existing record in the database at all.

So if this is not what you're seeing, please can you provide a reproducible test case with the actual results you're seeing. And also say what version of Netbox you're using.

There is another possibility though, which is that there are multiple instances of your script running concurrently. Your code has a race condition: first …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@xeb10154
Comment options

Comment options

You must be logged in to vote
1 reply
@xeb10154
Comment options

Answer selected by xeb10154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants