saltstack / saltstack/salt

[FEATURE REQUEST] Option for Error_stdout module similar to success_stdout module

Open
#68,193 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Is your feature request related to a problem? Please describe.

  • We are many a times getting into a situation where we are getting an success return or output from salt when our Backend app expects it to be an error. For example, we are using win_service module to get the current status of an windows service using command salt {{ id }} service.status {{ serviceName }}.
  • From minion version 3006.x, service.status returns a string "Not Found" instead of the actual error that Windows throws. It used to say "The service does not exist" and it returns as error.
  • Our Backend application expects it to send an error if service does not exist, and this change from version 3006.x broke it.
  • Also, i am not able to handle it in salt states directly, instead i am forced to use cmd.run module which impacted performance since this operation happens on lots of minions.

Describe the solution you'd like
Similar to success_stdout or success_stderr which works only for cmd.run, we can create an error_stdout module. But this should not be limited to cmd.run or cmd.script. We can use it across all the modules that returns an standard output from Minions.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
In addition to just manipulating the stdout and error, we can also enhance it to throw a custom output if a certain error or standard output occurs. Also, we can make sure this can be added into both success_stdout/stderror and error_stdout

Please Note
If this feature request would be considered a substantial change or addition, this should go through a SEP process here https://github.com/saltstack/salt-enhancement-proposals, instead of a feature request.

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 reviewing the existing success_stdout and success_stderr behavior for cmd.run and cmd.script, along with the service.status example in this issue. The request spans modules and may require a Salt Enhancement Proposal; the issue does not name files, tests, or a settled acceptance scope, so completion would require an agreed design before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.