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

Inconsistent behavior for duplicate values #33

Open
delboni opened this issue Sep 5, 2017 · 0 comments
Open

Inconsistent behavior for duplicate values #33

delboni opened this issue Sep 5, 2017 · 0 comments

Comments

@delboni
Copy link

delboni commented Sep 5, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.2.1
  • Ruby: ruby 2.1.6p336 (2015-04-13 revision 50298) [x64-mingw32]
  • Distribution: open source
  • Module version: 2.3.0

How to reproduce (e.g Puppet code you use)

When ensure=present, if the variable meets the criteria, i.e., value exists (insert), exists in the beggining (prepend) or exists in the end (append), duplicates won't be removed even if they are present. E.g.:

ensure=present
value=d
mergemode=insert:  VAR="a;d;b;d;c"   => VAR="a;d;b;d;c"
mergemode=prepend: VAR="d;a;d;b;d;c" => VAR="d;a;d;b;d;c"
mergemode=append:  VAR="a;d;b;d;c;d" => VAR="a;d;b;d;c;d"

Duplicates will only be removed if the variable doesn't meet the criteria and its content needs to be re-written, such as in

ensure=present
value=d
mergemode=prepend: VAR="a;d;b;d;c" => VAR="d;a;b;c"
mergemode=append:  VAR="a;d;b;d;c" => VAR="a;b;c;d"

What are you seeing

The module behaviors according to the variable contents, so we never know the outcome for a given client.

What behaviour did you expect instead

I expected it to behave the same way, no matter what the variable content is. It should either keep all duplicates, just changing places as needed for append/prepend; OR always eliminate them.

As we have problems with duplicated paths in PATH, we would love to eliminate duplicates. A parameter that dictates the behavior may also be a solution.

Output log

Any additional information you'd like to impart

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

No branches or pull requests

1 participant