Skip to content

Add delete_regex#605

Merged
jonnytdevops merged 1 commit intopuppetlabs:masterfrom
jyaworski:delete_optional_param
May 16, 2016
Merged

Add delete_regex#605
jonnytdevops merged 1 commit intopuppetlabs:masterfrom
jyaworski:delete_optional_param

Conversation

@jyaworski
Copy link
Copy Markdown

To maintain backwards compatibility, add a third parameter to the delete
function to specify what type the second should be interpreted as. This
is needed for cases where the regex matcher is overzealous.

This was uncovered while testing this against @smoeding's sendmail module as seen here:

smoeding/puppet-sendmail#8

@smoeding
Copy link
Copy Markdown
Contributor

Either that or introduce a new function delete_regex to clearly indicate a new functionality.

Trying to add the regex functionality to the delete function without giving the user control where the parameter should be used as literal or as regex is a disaster waiting to happen. Just think of all the characters (like '.', '*' or '?') that have a special meaning when used in a regex.

@hunner
Copy link
Copy Markdown
Contributor

hunner commented May 13, 2016

Yeah, I think delete_regex would make more sense from a UX perspective :)

To maintain backwards compatibility, add a delete_regex function instead
of modifying delete itself.
@jyaworski jyaworski changed the title Add a third param for the delete function Add delete_regex May 13, 2016
@jyaworski
Copy link
Copy Markdown
Author

@hunner done.

@jonnytdevops jonnytdevops merged commit b7e1f89 into puppetlabs:master May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants