From cecc6e0a5f8855809088fd5df6a603a1c182274b Mon Sep 17 00:00:00 2001 From: Mike Place Date: Mon, 29 Feb 2016 11:26:35 -0700 Subject: [PATCH 1/2] Don't stacktrace if ssh binary is not installed with salt-ssh --- salt/client/ssh/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py index d5fa13627e..c141c2a8f2 100644 --- a/salt/client/ssh/__init__.py +++ b/salt/client/ssh/__init__.py @@ -164,6 +164,8 @@ class SSH(object): else: self.event = None self.opts = opts + if not salt.utils.which('ssh'): + raise salt.exceptions.SaltSystemExit('No ssh binary found in path -- ssh must be installed for salt-ssh to run. Exiting.') self.opts['_ssh_version'] = ssh_version() self.tgt_type = self.opts['selected_target_option'] \ if self.opts['selected_target_option'] else 'glob' From 4e48fec8069ca14082f92479f24012d1235ca22b Mon Sep 17 00:00:00 2001 From: Justin Findlay Date: Wed, 2 Mar 2016 10:14:04 -0700 Subject: [PATCH 2/2] doc/topics/tutorials/http: update query decoding docs Fixes #31614. --- doc/topics/tutorials/http.rst | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/topics/tutorials/http.rst b/doc/topics/tutorials/http.rst index 3d995df727..4d3a14f4b5 100644 --- a/doc/topics/tutorials/http.rst +++ b/doc/topics/tutorials/http.rst @@ -224,12 +224,18 @@ of Salt's internal structure. Historically, the extension for this file is Return Data ~~~~~~~~~~~ -By default, ``query()`` will attempt to decode the return data. Because it was -designed to be used with REST interfaces, it will attempt to decode the data -received from the remote server. First it will check the ``Content-type`` header -to try and find references to XML. If it does not find any, it will look for -references to JSON. If it does not find any, it will fall back to plain text, -which will not be decoded. +.. note:: Return data encoding + + If ``decode`` is set to ``True``, ``query()`` will attempt to decode the + return data. ``decode_type`` defaults to ``auto``. Set it to a specific + encoding, ``xml``, for example, to override autodetection. + +Because Salt's http library was designed to be used with REST interfaces, +``query()`` will attempt to decode the data received from the remote server +when ``decode`` is set to ``True``. First it will check the ``Content-type`` +header to try and find references to XML. If it does not find any, it will look +for references to JSON. If it does not find any, it will fall back to plain +text, which will not be decoded. JSON data is translated into a dict using Python's built-in ``json`` library. XML is translated using ``salt.utils.xml_util``, which will use Python's