-
Notifications
You must be signed in to change notification settings - Fork 14
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
Reformatted User Methods #121
Conversation
This method will allow a user to query Netbox with a csv and return each device name and if they are in Netbox or not.
Missing tests added. Style changes made.
de7e04f
to
692e5ba
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #121 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 22 +4
Lines 446 468 +22
=========================================
+ Hits 446 468 +22 ☔ View full report in Codecov by Sentry. |
692e5ba
to
be57192
Compare
@@ -12,9 +10,9 @@ | |||
from pynetbox_query.utils.error_classes import DeviceFoundError, DeviceTypeNotFoundError | |||
|
|||
|
|||
class CsvToNetbox: | |||
class TopLevelMethods: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't particularly like the name of this file and class.
TopLevelMethods isn't exactly clear about the purpose of the class.
Perhaps something like pynetbox_utils and PynetboxUtils for filename and class name respectively
This also gets into the AND rule - this class is likely to get quite bloated and will be doing too many things. I think its fine for now - as more is added to the class, think about separating out concerns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at this further, you've already got a utils module so I'll get back to you about how we should refactor this
Moved most functions from csv_to_netbox into a new python file called top_level_methods. This is so the functions can be reused in any other user methods.
Added new user method that will print a list of True/False for each device in a csv file. This can be useful as you can verify quickly if a large amount of devices exist in Netbox or not.