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

Add --state-verbose command line option to salt cmd #26962

Merged
merged 2 commits into from Sep 14, 2015

Conversation

Projects
None yet
6 participants
@ctrlrsf
Contributor

ctrlrsf commented Sep 8, 2015

This overrides the state_verbose setting that may be set in master config.

Closes issue #13640

If master has state_verbose set to True

--state-verbose=False would suppress states that didn't change.

If master config has state_verbose set to False

--state-verbose=True would still show states that didn't have changes.

Below is test output with state_verbose=True in ./etc/salt/master:

$ salt -c ./etc/salt '*' --state-verbose=True  state.highstate
salt-dev:
----------
          ID: test_file.txt
    Function: file.managed
        Name: /tmp/test_file.txt
      Result: True
     Comment: File /tmp/test_file.txt exists with proper permissions. No changes made.
     Started: 13:51:15.798599
    Duration: 7.176 ms
     Changes:

Summary for salt-dev
------------
Succeeded: 1
Failed:    0
------------
Total states run:     1
Total run time:   7.176 ms

$ salt -c ./etc/salt '*' --state-verbose=False  state.highstate
salt-dev:

Summary for salt-dev
------------
Succeeded: 1
Failed:    0
------------
Total states run:     1
Total run time:   8.589 ms
Add --state-verbose command line option to salt cmd
This overrides the state_verbose setting that may be set in master config.

If master has state_verbose set to True

--state-verbose=False would suppress states that didn't change.

If master config has state_verbose set to False

--state-verbose=True would still show states that didn't have changes.

Below is test output with state_verbose=True in ./etc/salt/master:

```
$ salt -c ./etc/salt '*' --state-verbose=True  state.highstate
salt-dev:
----------
          ID: test_file.txt
    Function: file.managed
        Name: /tmp/test_file.txt
      Result: True
     Comment: File /tmp/test_file.txt exists with proper permissions. No changes made.
     Started: 13:51:15.798599
    Duration: 7.176 ms
     Changes:

Summary for salt-dev
------------
Succeeded: 1
Failed:    0
------------
Total states run:     1
Total run time:   7.176 ms

$ salt -c ./etc/salt '*' --state-verbose=False  state.highstate
salt-dev:

Summary for salt-dev
------------
Succeeded: 1
Failed:    0
------------
Total states run:     1
Total run time:   8.589 ms
```

cachedout added a commit that referenced this pull request Sep 14, 2015

Merge pull request #26962 from ctrlrsf/state-verbose-flag
Add --state-verbose command line option to salt cmd

@cachedout cachedout merged commit f0b41e4 into saltstack:develop Sep 14, 2015

2 of 5 checks passed

default Merged build finished.
Details
jenkins/salt-pr-linode-ubuntu14.04-n Salt PR - Linode Ubuntu 14.04 #437 — FAILURE
Details
jenkins/salt-pr-rs-cent7-n Salt PR - RS CentOS 7 #7911 — FAILURE
Details
jenkins/salt-pr-clone Salt PR - Clone Repository #9360 — SUCCESS
Details
jenkins/salt-pr-lint-n Salt PR - Code Lint #9082 — SUCCESS
Details
@cachedout

This comment has been minimized.

Show comment
Hide comment
@cachedout

cachedout Sep 14, 2015

Contributor

Great! Thank you!

Contributor

cachedout commented Sep 14, 2015

Great! Thank you!

@yermulnik

This comment has been minimized.

Show comment
Hide comment
@yermulnik

yermulnik Sep 15, 2015

(jail) [root#jail_salt][w:9][j:0][.../salt/states]> salt --version
salt 2015.8.0 (Beryllium)
(jail) [root#jail_salt][w:9][j:0][.../salt/states]> salt jail_salt --state-verbose=False state.highstate test=true
Usage: salt [options] '<target>' <function> [arguments]

salt: error: no such option: --state-verbose

ps: minion 'jail_salt' is the same node as master

yermulnik commented Sep 15, 2015

(jail) [root#jail_salt][w:9][j:0][.../salt/states]> salt --version
salt 2015.8.0 (Beryllium)
(jail) [root#jail_salt][w:9][j:0][.../salt/states]> salt jail_salt --state-verbose=False state.highstate test=true
Usage: salt [options] '<target>' <function> [arguments]

salt: error: no such option: --state-verbose

ps: minion 'jail_salt' is the same node as master

@ctrlrsf

This comment has been minimized.

Show comment
Hide comment
@ctrlrsf

ctrlrsf Sep 15, 2015

Contributor

@yermulnik This was merged into develop branch. Were you running 2015.08 branch? Notice --version difference below.

$ salt --version
salt 2015.8.0-412-gd4533d0 (Beryllium)
salt --help
...snip...
    --state-verbose=STATE_VERBOSE, --state_verbose=STATE_VERBOSE
                        Override the configured state_verbose value for minion
                        output. Set to True or FalseDefault: True
$ salt --state-verbose
Usage: salt [options] '<target>' <function> [arguments]

salt: error: --state-verbose option requires an argument
Contributor

ctrlrsf commented Sep 15, 2015

@yermulnik This was merged into develop branch. Were you running 2015.08 branch? Notice --version difference below.

$ salt --version
salt 2015.8.0-412-gd4533d0 (Beryllium)
salt --help
...snip...
    --state-verbose=STATE_VERBOSE, --state_verbose=STATE_VERBOSE
                        Override the configured state_verbose value for minion
                        output. Set to True or FalseDefault: True
$ salt --state-verbose
Usage: salt [options] '<target>' <function> [arguments]

salt: error: --state-verbose option requires an argument
@yermulnik

This comment has been minimized.

Show comment
Hide comment
@yermulnik

yermulnik Sep 15, 2015

This was merged into develop branch. Were you running 2015.08 branch?

@ctrlrsf guess it's not a dev branch on my side, is it?

(jail) [root#jail_salt][w:9][j:0][.../salt/states]> salt --versions-report
Salt Version:
           Salt: 2015.8.0

[...]

System Versions:
           dist:
        machine: amd64
        release: 10.1-RELEASE-p19

It's FreeBSD.

ps: I thought this option was merged into 2015.8.0. excuses for the noise =)

yermulnik commented Sep 15, 2015

This was merged into develop branch. Were you running 2015.08 branch?

@ctrlrsf guess it's not a dev branch on my side, is it?

(jail) [root#jail_salt][w:9][j:0][.../salt/states]> salt --versions-report
Salt Version:
           Salt: 2015.8.0

[...]

System Versions:
           dist:
        machine: amd64
        release: 10.1-RELEASE-p19

It's FreeBSD.

ps: I thought this option was merged into 2015.8.0. excuses for the noise =)

@Grokzen

This comment has been minimized.

Show comment
Hide comment
@Grokzen

Grokzen Nov 18, 2015

@ctrlrsf In what release is this in? 8.0 or 8.1? Any backport to 5.x?

Grokzen commented Nov 18, 2015

@ctrlrsf In what release is this in? 8.0 or 8.1? Any backport to 5.x?

basepi added a commit that referenced this pull request Jan 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment