Device-Type-Library-Import icon indicating copy to clipboard operation
Device-Type-Library-Import copied to clipboard

request: a way to filter which module types are created

Open kquinsland opened this issue 5 months ago • 0 comments

Right now, the importer script checks to see if you have netbox 4.3. If yes, module support is enabled.

Later, a check for modules=True is done and if yes, module types are imported. The problem is that you can't use --slug to filter modules because those files do not have a slug.

Your only option is to make a small change to the code (which effectively negates the "if not module, skip") and thus installs all the module types or filter by vendor, only.

I can think of a few ways around this:

  • use regex instead of slug. Match on the file path. This would be the most powerful method since you can specify the manufacturer name as part of the path and might not require that much refactoring... especially if you remove the --slug filter altogether. If slug: for module-types does not come to netbox in future versions,
  • introduce a slug: to the module-type yaml files and remove it from the parsed dict before sending it to the server
  • do nothing / keep the existing functionality (or apply the patch from #117) and require that users delete all the module type files that they don't want to create inadvertently/

kquinsland avatar Jun 22 '25 00:06 kquinsland