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] file.symlink no longer uses file.mod_check_cmd #66939

Open
OrangeDog opened this issue Oct 1, 2024 · 0 comments
Open

[BUG] file.symlink no longer uses file.mod_check_cmd #66939

OrangeDog opened this issue Oct 1, 2024 · 0 comments
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@OrangeDog
Copy link
Contributor

OrangeDog commented Oct 1, 2024

Description
The file state module has custom check_cmd logic for running with a temporary file.
This used to work for file.symlink, but has regressed in 3006 (LTS).

Setup
For example, a onedir installation managing a Debian webserver:

/etc/nginx/sites-enabled/default:
  file.symlink:
    - target: /etc/nginx/sites-available/default
    - check_cmd: nginx -t -c

Steps to Reproduce the behavior
Apply the above state:

[INFO] Running state [/etc/nginx/sites-enabled/default] at time 11:13:20.485750
[INFO] Executing state file.symlink for [/etc/nginx/sites-enabled/default]
[INFO] Executing command 'n' in directory '/root'
[DEBUG] stdout: /bin/sh: 1: n: not found
[DEBUG] retcode: 127
[DEBUG] Last command return code: 127
[ERROR] check_cmd determined the state failed
[INFO] Completed state [/etc/nginx/sites-enabled/default] at time 11:13:20.492677 (duration_in_ms=6.927)

Expected behavior
As in previous versions, it should create a temporary symlink first and then pass append that to the given command.

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.14.6
      cherrypy: 18.6.1
  cryptography: 42.0.5
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.4
       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.19.1
        pygit2: Not Installed
  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-45-generic
        system: Linux
       version: Ubuntu 24.04.1 noble

Additional context
Presumably caused by #63970

@OrangeDog OrangeDog added Bug broken, incorrect, or confusing behavior needs-triage labels Oct 1, 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