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

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

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

jantari
Copy link

@jantari jantari commented Jul 7, 2022

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

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

@sc68cal
Copy link
Contributor

sc68cal commented Jul 7, 2022

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

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.

2 participants