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 Return Data
~~~~~~~~~~~ ~~~~~~~~~~~
By default, ``query()`` will attempt to decode the return data. Because it was .. note:: Return data encoding
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 If ``decode`` is set to ``True``, ``query()`` will attempt to decode the
to try and find references to XML. If it does not find any, it will look for return data. ``decode_type`` defaults to ``auto``. Set it to a specific
references to JSON. If it does not find any, it will fall back to plain text, encoding, ``xml``, for example, to override autodetection.
which will not be decoded.
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. 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 XML is translated using ``salt.utils.xml_util``, which will use Python's

View File

@ -169,6 +169,8 @@ class SSH(object):
else: else:
self.event = None self.event = None
self.opts = opts 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.opts['_ssh_version'] = ssh_version()
self.tgt_type = self.opts['selected_target_option'] \ self.tgt_type = self.opts['selected_target_option'] \
if self.opts['selected_target_option'] else 'glob' if self.opts['selected_target_option'] else 'glob'