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] pkgrepo.managed does not report changes when it cleans a .list #67034

Open
OrangeDog opened this issue Nov 4, 2024 · 0 comments
Open
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@OrangeDog
Copy link
Contributor

OrangeDog commented Nov 4, 2024

Description
If the given line is already present in the file, but clean_file is true, Salt will clean the file but not report any changes.

Setup

salt repo:
  pkgrepo.managed:
    - name: >
        deb [arch=amd64 signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg]
        http://packages.broadcom.com/artifactory/saltproject-deb/
        stable main
    - file: /etc/apt/sources.list.d/salt.list
    - clean_file: true
    - key_url: https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public
    - aptkey: false

Steps to Reproduce the behavior

# cat /etc/apt/sources.list.d/salt.list
deb [arch=amd64 signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg] http://repo.saltproject.io/salt/py3/ubuntu/24.04/amd64/latest noble main
deb [arch=amd64 signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg] http://repo.saltproject.io/salt/py3/ubuntu/24.04/amd64/3006 noble main
deb [arch=amd64 signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg] http://repo.saltproject.io/salt/py3/ubuntu/24.04/amd64/minor/3006.9 noble main
deb [arch=amd64 signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg] http://packages.broadcom.com/artifactory/saltproject-deb/ stable main

# salt-call state.apply
local:

Summary for local
--------------
Succeeded: 264
Failed:      0
--------------
Total states run:     264
Total run time:    22.334 s

# cat /etc/apt/sources.list.d/salt.list
deb [arch=amd64 signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg] http://packages.broadcom.com/artifactory/saltproject-deb/ stable main

Expected behavior
The state should report changes if it changed something.

Versions Report

salt --versions-report
Salt Version:
          Salt: 3006.9

Python Version:
        Python: 3.10.14 (main, Jun 26 2024, 11:44:37) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.17.1
      cherrypy: unknown
  cryptography: 42.0.5
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.4
       libgit2: 1.7.2
  looseversion: 1.0.2
      M2Crypto: 0.38.0
          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.19.1
        pygit2: 1.14.1
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.17.0
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: ubuntu 24.04.1 noble
        locale: utf-8
       machine: x86_64
       release: 6.8.0-48-generic
        system: Linux
       version: Ubuntu 24.04.1 noble
@OrangeDog OrangeDog added Bug broken, incorrect, or confusing behavior needs-triage labels Nov 4, 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 needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant