ansible_modules icon indicating copy to clipboard operation
ansible_modules copied to clipboard

Improve Name-to-Slug parsing to better align with Netbox UI

Open jantari opened this issue 3 years ago • 1 comments

Related Issue

#808

New Behavior

  1. Remove all non-ASCII characters (such as german umlauts)
  2. Strip / Trim before replacing spaces with dashes so that trailing dashes are eliminated

Contrast to Current Behavior

The generated slug names will align better with what the Netbox UI would auto-suggest / use and errors due to umlauts in site names are prevented.

Discussion: Benefits and Drawbacks

  • I believe this will help international (non-US) users of the module with more easily creating their sites or other assets in Netbox without having to do any custom pre-processing to pre-create the slug themselves in Jinja2
  • I cannot think of any drawbacks but I am not a fluent Python programmer so I may have missed something

Changes to the Documentation

I updated the test, but cannot think of anz Wiki or Docs changes required.

Proposed Release Note Entry

Improve Name-to-Slug parsing to better align with Netbox UI

Double Check

  • [X] I have read the comments and followed the CONTRIBUTING.md.
  • [X] I have explained my PR according to the information in the comments or in a linked issue.
  • [X] My PR targets the devel branch.

jantari avatar Jul 07 '22 08:07 jantari

I don't think stripping out any non-ASCII characters is good for i18n.

sc68cal avatar Jul 07 '22 14:07 sc68cal