Skip to content

saltclass list override '^' is literal for single list #50755

Closed

Description

@mrichar1

Description

When using the override marker (^) at the start of a list, this is translated as a literal ^ if there are no other lists to override.

Setup/Steps to Reproduce Issue

For example, with a state set up to install all packages in a list:

states/pkg.yml

{% for pkg in pillar.get('pkgs', []) %}
pkg_{{pkg}}:
  pkg.installed:
    - name: {{pkg}}
{% endfor %}

nodes/foo.yml

classes:
  - a
  - b

states:
  - pkgs

classes/a.yml

pillars:
  pkgs:
    - one
    - two

classes/b.yml

pillars:
  pkgs:
    - ^
    - three

Works as expected:

$ salt 'foo' state.apply | grep updated
Comment: The following packages would be installed/updated: three

However, if only the the 'override list' is used:

nodes/foo.yml

classes:
  - b

states:
  - pkgs

We get:

$ salt 'foo' state.apply | grep updated
Comment: The following packages would be installed/updated: ^
Comment: The following packages would be installed/updated: three

Versions Report

Salt Version:
Salt: 2018.3.0

Dependency Versions:
cffi: Not Installed
cherrypy: unknown
dateutil: 2.6.1
docker-py: Not Installed
gitdb: 2.0.3
gitpython: 2.1.8
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.7
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: 2.0.3
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.2.5

System Versions:
dist: Ubuntu 18.04 bionic
locale: UTF-8
machine: x86_64
release: 4.15.0-39-generic
system: Linux
version: Ubuntu 18.04 bionic

Activity

  1. changed the title [-]saltclass list merge '^' is literal in first list[/-] [+]saltclass list override '^' is literal for single list[/+] on Dec 5, 2018
  2. dwoz commented on Dec 7, 2018

    @dwoz
    Contributor

    @mrichar1 Thank you for reporting this.

  3. added
    bug
    P4
    severity-low
    on Dec 7, 2018
  4. added this to the Approved milestone on Dec 7, 2018
  5. added a commit that references this issue on Feb 1, 2019
    082be7b
  6. added a commit that references this issue on Mar 18, 2019
    511128d
  7. stale commented on Jan 9, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

  8. mrichar1 commented on Jan 9, 2020

    @mrichar1
    ContributorAuthor

    Still needs fixing.

  9. stale commented on Jan 9, 2020

    @stale

    Thank you for updating this issue. It is no longer marked as stale.

  10. removed
    P4
    on Jun 3, 2020
  11. added a commit that references this issue on Aug 4, 2026
    c7a5d71
  12. dhs-rec commented on Oct 13, 2026

    @dhs-rec
    Contributor

    BTW: This does NOT work at all, if other pillar sources than saltclass exist (let's say Gitpillar). It always leaves the caret in pillar lists, only the position differs, depending on the order the different ext_pillar modules are listed in the Salt master configuration.

    IMHO this caret thing should be removed altogether and Saltclass should simply follow the configured pillar merge rules.

  13. dhs-rec commented on Oct 14, 2026

    @dhs-rec
    Contributor

    Looks like this PR also fixes that problem.

  14. added a commit that references this issue on Oct 27, 2026
    7b35ef5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugseverity-low

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions