-
Notifications
You must be signed in to change notification settings - Fork 15
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
Created Argparse user method. #106
Merged
Merged
Conversation
This file contains 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
The underlying code hasn't been tested in a while with a real netbox connection. These changes fix issues allowing devices to be created.
This keeps the code more organised and readable.
This is clearer when using imported methods because it shows api as an argument and not netbox.
Moved argparse logic into an independent function. Made a function to use the new class and do the methods.
This makes sure pytest doesn't try to run setup.py as it does not need to be run or tested.
Now .pylintrc only contains necessary disabled warnings. Added docstrings.
When formatting data in dictionaries. 2 enums files are used to provide the correct netbox attribute for a category of data. When choosing which enum to search the key value was not in uppercase like the enums values.
Changed classes to accept "api" parameter rather than netbox. Also added some pretty print statements to describe what is happening when the script is run.
khalford
force-pushed
the
argparse_user
branch
from
October 20, 2023 10:11
14bf669
to
b0be9e6
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #106 +/- ##
===========================================
- Coverage 96.52% 73.38% -23.15%
===========================================
Files 16 13 -3
Lines 1036 263 -773
===========================================
- Hits 1000 193 -807
- Misses 36 70 +34
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
meoflynn
requested changes
Oct 20, 2023
meoflynn
approved these changes
Oct 30, 2023
RWhiting78
approved these changes
Oct 30, 2023
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.
This method allows a user to run a python script from the terminal with parameters to upload data from a csv into Netbox. There are lib code changes as the code hasn't been tested with a Netbox connection in a while.