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] extfs.tune doesn't pass retcode to module.run #65686

Closed
nicholasmhughes opened this issue Dec 11, 2023 · 0 comments · Fixed by #65687
Closed

[BUG] extfs.tune doesn't pass retcode to module.run #65686

nicholasmhughes opened this issue Dec 11, 2023 · 0 comments · Fixed by #65687
Assignees
Labels
Bug broken, incorrect, or confusing behavior Execution-Module

Comments

@nicholasmhughes
Copy link
Collaborator

Description
If running extfs.tune via the module.run state, the Result is always "True" (successful) even if the command fails. See state output below:

local:
----------
          ID: stuff
    Function: module.run
      Result: True
     Comment: extfs.tune: ['tune2fs: No such file or directory while trying to open /dev/donkey', "Couldn't find valid filesystem superblock.", 'tune2fs 1.44.5 (15-Dec-2018)']
     Started: 15:25:14.681118
    Duration: 225026.936 ms
     Changes:   
              ----------
              extfs.tune:
                  - tune2fs: No such file or directory while trying to open /dev/donkey
                  - Couldn't find valid filesystem superblock.
                  - tune2fs 1.44.5 (15-Dec-2018)

Setup

SLS file mimicing the extfs.tune command from the documentation:

# /srv/salt/extfs.sls

stuff:
  module.run:
  - extfs.tune:
    - device: /dev/donkey
    - force: true
    - label: wildstallyns
    - opts: 'acl,noexec'

Steps to Reproduce the behavior
Run a state.apply on the SLS file above. Assuming you don't have a "donkey" device, the execution module will fail with a successful state run.

Expected behavior
Execution module failures should produce state failures.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
                     Salt: 3007.0+0na.f0c3a19
 
Python Version:
                   Python: 3.7.3 (default, Oct 11 2023, 09:51:27)
 
Dependency Versions:
                     cffi: 1.15.1
                 cherrypy: Not Installed
                 dateutil: Not Installed
                docker-py: Not Installed
                    gitdb: Not Installed
                gitpython: Not Installed
                   Jinja2: 3.1.2
                  libgit2: Not Installed
             looseversion: 1.0.3
                 M2Crypto: Not Installed
                     Mako: Not Installed
                  msgpack: 1.0.5
             msgpack-pure: Not Installed
             mysql-python: Not Installed
                packaging: 23.2
                pycparser: 2.21
                 pycrypto: 2.6.1
             pycryptodome: 3.19.0
                   pygit2: Not Installed
             python-gnupg: Not Installed
                   PyYAML: 6.0.1
                    PyZMQ: 25.0.2
                   relenv: Not Installed
                    smmap: Not Installed
                  timelib: Not Installed
                  Tornado: 4.5.3
                      ZMQ: 4.3.4
 
Salt Extensions:
 salt-analytics-framework: 0.5.0
 
System Versions:
                     dist: debian 10.13 buster
                   locale: UTF-8
                  machine: x86_64
                  release: 4.19.0-25-amd64
                   system: Linux
                  version: Debian GNU/Linux 10.13 buster
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 Execution-Module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant