Merge pull request #31630 from rallytime/merge-2015.8

[2015.8] Merge forward from 2015.5 to 2015.8
This commit is contained in:
Nicole Thomas 2016-03-02 13:49:51 -07:00
commit 191241e71a
2 changed files with 14 additions and 6 deletions

View File

@ -233,12 +233,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

View File

@ -169,6 +169,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'