Search code examples
salt-project

http.query text_out is written to console


I'm trying to use the http.query state in saltstack in order to download some tgz archive through an api.

Through text_out I was able to write the respone data into a file which is great, however the file contents (the response data) is also written to the output. This is problematic because it spams the output with tgz nonsense- which in turn partly hide the meaningful output (the state status) as well.

Do you know of a way to hide the response, something like quiet?

Originally I tried using archive.extracted, however the api I'm using requires an authentication and I couldn't find a way to make it work that way.

Thanks in advance


Solution

  • You can set text=False if text_out is set,

    text=False,
    text_out='/tmp/text'
    

    more on http.query()