salt: Outputter names are not properly documented and/or some outputters are broken

Description of Issue/Question

If you want to use the “–output=” feature of the CLI, Googling “saltstack outputters” gets you here via the first link. The outputters listed are:

highstate
json_out
key
nested
newline_values_only
no_out
no_return
overstatestage
pony
pprint_out
progress
raw
table_out
txt
virt_query
yaml_out

Unfortunately, trying to use those results in weirdness and stack traces. See my shell script below.

Setup

set -x
CONFIG_DIR=$(mktemp -d)
FILE_ROOT=$(mktemp -d)
ROOT_DIR=$(mktemp -d)

OUTS=$(cat <<EOF
highstate
json_out
key
nested
newline_values_only
no_out
no_return
overstatestage
pony
pprint_out
progress
raw
table_out
txt
virt_query
yaml_out
EOF
    )

cat <<EOF > $CONFIG_DIR/minion
minion_id: foo
root_dir: $ROOT_DIR
file_roots:
  base:
    - $FILE_ROOT
EOF

cat <<EOF > $FILE_ROOT/test.sls
{{ sls }}:test:
  test.fail_without_changes
EOF

for line in $OUTS; do
    salt-call --local --log-level=error --config-dir=$CONFIG_DIR --retcode-passthrough --output=$line state.sls test
    echo "Exit: $?"
done;

rm -rf $CONFIG_DIR $FILE_ROOT $ROOT_DIR

Steps to Reproduce Issue

Running the above script results in the following:

  • highstate – Correct
  • json_out[ERROR ] Invalid outputter json_out specified, fall back to nested
  • key – ???
  • nested – ???
  • newline_values_only – ???
  • no_out[ERROR ] Invalid outputter no_out specified, fall back to nested
  • no_returnSame as nested
  • overstatestage[ERROR ] Nested output failed: stack trace
  • pony[ERROR ] Invalid outputter pony specified, fall back to nested
  • pprint_out[ERROR ] Invalid outputter pprint_out specified, fall back to nested
  • progress[ERROR ] Invalid outputter progress specified, fall back to nested
  • raw – ???
  • table_out[ERROR ] Invalid outputter table_out specified, fall back to nested
  • txt – ???
  • virt_query[ERROR ] Nested output failed: stack trace
  • yaml_out[ERROR ] Invalid outputter yaml_out specified, fall back to nested

I’ve tried to call out the obvious problems. Elsewhere, “???” means “I don’t know if the output is formatted correctly or not.”

Versions Report

Salt Version:
           Salt: 2017.7.0-368-g0f9a486
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: 2.0.2
      gitpython: 2.1.5
          ioflo: Not Installed
         Jinja2: 2.9.6
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.5.3 (default, Jan 19 2017, 14:11:04)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.3
        timelib: Not Installed
        Tornado: 4.5.1
            ZMQ: 4.1.6
 
System Versions:
           dist: Ubuntu 17.04 zesty
         locale: UTF-8
        machine: x86_64
        release: 4.12.0-041200-generic
         system: Linux
        version: Ubuntu 17.04 zesty

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 18 (8 by maintainers)

Most upvoted comments

@anitakrueger I just opened https://github.com/saltstack/salt/pull/55566 to add some outputter docs.