Skip to content

Inconsistent behavior for duplicate values #33

@delboni

Description

@delboni

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions