saltstack / saltstack/salt

[BUG] Silent flag does not work on file.directory recurse

Open
#60,597 2 comments 0 reactions 1 assignee View on GitHub

@cmcmarrow is already working on this.

Since Jul 21, 2021.

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

Description

Description
Setting silent=True in file.managed does not prevent individual file changes from being printed.

Setup
Per the documentation, under recurse: "If silent is defined, individual file/directory change notifications will be suppressed."
As defined in the sls file, silent is set to true.

newrelic_directory_perms:
  file.directory:
    - name: /opt/newrelic/
    - user: {{ user }}
    - group: {{ group }}
    - dir_mode: 755
    - file_mode: 755
    - silent: True
    - recurse:
      - user
      - group
      - mode

But the output still shows:

     Changes:
              ----------
              /opt/newrelic/log/newrelic_agent.log:
                  ----------
                  mode:
                      0755
              /opt/newrelic/log/newrelic_agent.log.2021-05-15:
                  ----------
                  mode:
                      0755
....

and on and on and on for every individual log file

Steps to Reproduce the behavior
Define silent in file.directory state, with recurse options

Expected behavior
A single "success" message, or something similar. No output for every individual file and/or directory.

Screenshots
N/A

Versions Report

salt --versions-report
Salt Version:
           Salt: 3000.6

Dependency Versions:
           cffi: 1.6.0
       cherrypy: unknown
       dateutil: 2.6.0
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
         Jinja2: 2.11.3
        libgit2: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.6.2
   mysql-python: Not Installed
      pycparser: 2.14
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.16 (default, Sep 13 2019, 20:28:21)
   python-gnupg: Not Installed
         PyYAML: 3.10
          PyZMQ: 15.3.0
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.1.4

System Versions:
           dist:
         locale: UTF-8
        machine: x86_64
        release: 4.14.146-119.123.amzn2.x86_64
         system: Linux
        version: Not Installed

Additional context
Add any other context about the problem here.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.