Move debug print before netbox_create_or_update#398
Open
shbatm wants to merge 1 commit intoSolvik:masterfrom
Open
Move debug print before netbox_create_or_update#398shbatm wants to merge 1 commit intoSolvik:masterfrom
shbatm wants to merge 1 commit intoSolvik:masterfrom
Conversation
Previously, if an error occurred during netbox_create_or_update(), the debug information would never be printed since print_debug() was called after the update. This moves the debug print to occur before the update attempt, ensuring debug data is visible even when errors occur. Also adds documentation for the --debug flag which was previously undocumented in both README.md and the example config file. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
3e1d9d7 to
34f18c0
Compare
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.
Problem
Previously, if an error occurred during
netbox_create_or_update(), the debug information would never be printed sinceprint_debug()was called after the update operation. This made troubleshooting failures difficult since you couldn't see the data that was being sent to Netbox.Solution
This PR moves the debug print to occur before the update attempt, ensuring debug data is visible even when errors occur. It also adds documentation for the
--debugflag which was previously undocumented.Changes
server.print_debug()call in cli.py to execute beforeserver.netbox_create_or_update(config)debugoption to netbox_agent.yaml.exampleTesting
The change preserves all existing functionality - debug output just occurs earlier in the execution flow.
🤖 Generated with Claude Code