Your first returner

Go ahead and open up salt/returners/ There's not much in here, but what we're interested in is the returner() function. It's very, very small:

def returner(ret):
    Print the return data to the terminal to verify functionality

In fact, all it does is accept return data as ret, and then print it to the console. It doesn't even attempt any sort of pretty printing; it just dumps it as is.

This is in fact the bare minimum that a returner needs: a returner() function that accepts a dictionary, and then does something with it. Let's go ahead and create our own returner, which stores job information locally in JSON format.

''' Store return data locally in JSON format This file should be saved as salt/returners/ ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.