Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Reformatted User Methods #121

wants to merge 3 commits into from

Conversation

khalford
Copy link
Member

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.

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.
@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (db94762) 100.00% compared to head (be57192) 100.00%.

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.
📢 Have feedback on the report? Share it here.

@@ -12,9 +10,9 @@
from pynetbox_query.utils.error_classes import DeviceFoundError, DeviceTypeNotFoundError


class CsvToNetbox:
class TopLevelMethods:
Copy link
Collaborator

@anish-mudaraddi anish-mudaraddi Nov 14, 2023

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

Copy link
Collaborator

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

@khalford khalford closed this Nov 14, 2023
@khalford khalford deleted the user_methods branch November 24, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants