netbox-community / customizations

A collection of community submitted and maintained customizations including reports, scripts, validators and export templates
MIT License
204 stars 55 forks source link

Update missing_device_type_components.py to check more than just names #77

Open ryanmerolle opened 1 year ago

ryanmerolle commented 1 year ago

Update missing_device_type_components.py to check more than just names of items.

ryanmerolle commented 1 year ago

@candlerb I started with this

Thoughts?

danner26 commented 1 year ago

Hey Ryan, just throwing this here as well since sometimes things get buried in slack.

Maybe you can build a hash table rather than using nested for loops? Data structures has never been my forte, but I do recall some of the math. Those 4 nested for loops are probably creating a lot of time complexity

candlerb commented 1 year ago

Thoughts?

I think this should be a separate report, because there are two distinct things you might want to do:

That is: you may have intentionally changed something from the device type in a specific device, and don't want to be prompted about it all the time.

ryanmerolle commented 1 year ago

That is: you may have intentionally changed something from the device type in a specific device, and don't want to be prompted about it all the time.

Good point. So a name focused Class like the original and a full detail Class.

ryanmerolle commented 1 year ago

Using @kkthxbye-code https://gist.github.com/kkthxbye-code/6d6f017e590d3271cbd1071fcb4840be as an example to refactor