Troubleshooting outputters

Outputters can be one of the easiest types of module to troubleshoot. You should be able to test any of them using the salt-call command.

When testing, start with a simple test.ping, just to make sure that you are getting some output in the first place. Once you're satisfied that your output() function is returning simple data that looks correct, take a look at grains.items, which will make use of both lists and dictionaries.

You may find it useful to test your output against another outputter that is known to work well. I find that the pprint outputter tends to be the most succinct at displaying data in a format that is easy to read, but takes the least amount of screen real-estate:

# salt-call --local grains.items --out ...

Get Extending SaltStack now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.