Repository navigation
netbox: send no DELETE request while pruning is disabled - #613
Merged
Merged
Conversation
A virtual disk which is gone from vCenter and the tags of this program which no object uses anymore were deleted on every run, whatever prune_enabled said. A token which may not delete is the natural setup for a disabled pruning, and NetBox answers each of those requests with a 403, which ends the run, for a disk in the middle of the update. Delete both only if pruning is enabled, a disk which vanished from vCenter stays in NetBox otherwise. Part of #537.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
prune_enabled = Falsenetbox-sync still sent DELETE requests in two places: for a virtual disk which is gone from vCenter (update_object, last run) and for tags of this program which no object uses anymore (delete_unused_tags, end of every run). A token without the delete permission is the natural setup for a disabled pruning. NetBox answers each of these requests with a 403, andrequest()ends the run on a 403, in the disk case in the middle of the update.Both are done only if pruning is enabled now. A disk which vanished from vCenter stays in NetBox otherwise, so with the default (
prune_enabled = False) it is no longer deleted. The option description says that no DELETE is sent while pruning is disabled.--purgeis not touched.The tests count the DELETE requests of a handler with a stubbed
request(). The two with pruning disabled fail ondevelopment(a DELETE for the disk and one for the tag) and pass with this change, the two controls with pruning enabled pass in both cases. The rest of the suite is unchanged (525 passed on a box without vcsim, the vcsim tests run in CI). The generated example config matches the new option text.Item 1 of #537, reported by @jamespage001.