Skip to content

Allow configurable separator for {module_path} placeholder #21667

@mrmrcoleman

Description

@mrmrcoleman

NetBox version

v4.5.2

Feature type

Change to existing functionality

Proposed functionality

The {module_path} placeholder (introduced in #21436) currently joins module bay positions with a hardcoded / separator (MODULE_TOKEN_SEPARATOR in dcim/constants.py). This works well for the common <unit>/<slot>/<port> naming convention used by most modern switches and routers, but some hardware uses different separators:

  • : for channelized interfaces (e.g. 1/2:3)
  • - for certain legacy platforms
  • . for sub-interface style naming

It would be useful to allow the separator to be configurable, either:

  1. Per-template: A separator field on component templates that use {module_path}, or
  2. Per-ModuleType: A separator property on the ModuleType itself, or
  3. Globally: A configurable setting (though this is the least flexible option)

Justification

This was raised during review of #21436 by @sleepinggenius2 and @arthanson. The current constant-based approach was chosen deliberately to keep the initial {module_path} implementation simple, with the expectation that configurability could be added as a follow-up.

Related

Metadata

Metadata

Assignees

Labels

netboxtype: featureIntroduction of new functionality to the application

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions