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

Respect the TRANSFORM_INVALID_GROUP_CHARS setting #138

Merged
merged 1 commit into from
Aug 16, 2021

Conversation

tadeboro
Copy link
Contributor

Up until now, the inventory plugin always replaced invalid characters in group names, which can be a bit surprising when we generate groups on things such as droplet tags. To make things even more confusing, the TRANSFORM_INVALID_GROUP_CHARS configuration option is completely ignored, giving users no way of preserving original names.

This commit replaces the default group name sanitization function with the one that respects the TRANSFORM_INVALID_GROUP_CHARS configuration option.

Fixes #133

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

Inventory plugin

@codecov
Copy link

codecov bot commented Jul 26, 2021

Codecov Report

Merging #138 (05fd171) into main (74df3b3) will increase coverage by 7.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #138      +/-   ##
==========================================
+ Coverage   65.27%   72.34%   +7.06%     
==========================================
  Files          35        1      -34     
  Lines        2534       94    -2440     
  Branches      494       17     -477     
==========================================
- Hits         1654       68    -1586     
+ Misses        602       24     -578     
+ Partials      278        2     -276     
Impacted Files Coverage Δ
plugins/inventory/digitalocean.py 72.34% <100.00%> (+0.60%) ⬆️
plugins/modules/digital_ocean_kubernetes.py
plugins/modules/digital_ocean_image_info.py
plugins/modules/digital_ocean_volume_info.py
plugins/modules/digital_ocean_vpc_info.py
plugins/modules/digital_ocean_snapshot_info.py
plugins/modules/digital_ocean_snapshot.py
plugins/modules/digital_ocean_tag.py
plugins/modules/digital_ocean_domain_record.py
plugins/modules/digital_ocean_project.py
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74df3b3...05fd171. Read the comment docs.

Up until now, the inventory plugin always replaced invalid characters
in group names, which can be a bit surprising when we generate groups
on things such as droplet tags. To make things even more confusing,
the TRANSFORM_INVALID_GROUP_CHARS configuration option is completely
ignored, giving users no way of preserving original names.

This commit replaces the default group name sanitization function with
the one that respects the TRANSFORM_INVALID_GROUP_CHARS configuration
option.
Copy link
Collaborator

@mamercad mamercad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @tadeboro!

@mamercad mamercad merged commit fe331f0 into ansible-collections:main Aug 16, 2021
@tadeboro tadeboro deleted the group-names branch August 16, 2021 19:26
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.

Droplet tags with "dashes" are being replaced by "underscores" in DO ansible dynamic inventory
2 participants