saltstack / saltstack/salt

[BUG] pkg.group_installed says group is partially installed and will be updated when test=true

Open
#64,634 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Confirmed Linux
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
Running salt state.sls with test=true indicates there is a change to be applied when a package is included in pkg.group_installed.

Setup
Example sls:

pkgs_group_desktop_environment:
    pkg.group_installed:
        - name: xfce-desktop
        - skip:
            - xfce4-power-manager
        - include:
            -  pinentry-gtk #conditional package
  • on-prem machine
  • onedir packaging

Steps to Reproduce the behavior

salt-call --state-verbose=false --state-output=changes state.sls yann.test test=true
local:
----------
          ID: pkgs_group_desktop_environment
    Function: pkg.group_installed
        Name: Xfce
      Result: None
     Comment: Group 'Xfce' is partially installed and will be updated
     Started: 17:02:36.844530
    Duration: 4017.86 ms
     Changes:

Summary for local
------------
Succeeded: 1 (unchanged=1)
Failed:    0
------------
Total states run:     1
Total run time:   4.018 s

And nothing applied when running without test=true

salt-call --state-verbose=false --state-output=changes state.sls yann.test saltenv=base pillarenv=base
local:

Summary for local
------------
Succeeded: 1
Failed:    0
------------
Total states run:     1
Total run time:  12.193 s

Expected behavior
No unchanged state when running with test=true

Versions Report

salt --versions-report
Salt Version:
          Salt: 3006.1

Python Version:
        Python: 3.10.11 (main, May  5 2023, 02:31:54) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 5.4.1
         PyZMQ: 23.2.0
        relenv: 0.12.3
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: centos 7.9.2009 Core
        locale: utf-8
       machine: x86_64
       release: 3.10.0-1160.88.1.el7.x86_64
        system: Linux
       version: CentOS Linux 7.9.2009 Core

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the implementation and tests for the pkg.group_installed state, then reproduce the behavior with test=true using the provided SLS example. Compare the test-mode result with the normal run and add coverage showing that an unchanged group does not report a pending update; done means the reproduced state reports no change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.