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

[BUG] salt.states.grains.list_present append already existing values #61869

Open
dereckson opened this issue Mar 28, 2022 · 0 comments
Open

[BUG] salt.states.grains.list_present append already existing values #61869

dereckson opened this issue Mar 28, 2022 · 0 comments
Labels
Bug broken, incorrect, or confusing behavior severity-high 2nd top severity, seen by most users, causes major problems

Comments

@dereckson
Copy link
Contributor

Description
According the documentation, salt.states.grains.list_present should only add a value to a a grain formatted as a list if it doesn't exist.

It's possible to pass multiple grains, but then, if one of them isn't present, the full list is added, including already existing items.

Steps to Reproduce the behavior
A minimal repro case from the salt.states doc and an update:

server_roles:
  grains.list_present:
    - value:
      - web
      - dev

server_roles_one_more_time:
  grains.list_present:
    - name: server_roles
    - value:
      - web
      - mail
      - dev

Expected behavior
grain serve_roles should contain web, dev, mail, only once for web and dev

Versions Report
salt 3004.1, repro with salt-call --local

@dereckson dereckson added Bug broken, incorrect, or confusing behavior needs-triage labels Mar 28, 2022
@Ch3LL Ch3LL added severity-high 2nd top severity, seen by most users, causes major problems and removed needs-triage labels Dec 14, 2022
@Ch3LL Ch3LL added this to the Chlorine v3007.0 milestone Dec 14, 2022
@dwoz dwoz unassigned Ch3LL Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior severity-high 2nd top severity, seen by most users, causes major problems
Projects
None yet
Development

No branches or pull requests

2 participants