Merge branch '2017.7' into fix_puppet.fact_and_puppet.facts

This commit is contained in:
Peter Morris 2018-03-21 20:31:46 +00:00 committed by GitHub
commit 0ce1520bd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 13 deletions

View file

@ -1,8 +1,8 @@
.. _all-salt.clouds:
===============================
Full list of Salt Cloud modules
===============================
=============
cloud modules
=============
.. currentmodule:: salt.cloud.clouds

View file

@ -53,7 +53,7 @@ import salt.ext.six as six
from salt.ext.six.moves import input # pylint: disable=import-error,redefined-builtin
try:
import saltwinshell
HAS_WINSHELL = False
HAS_WINSHELL = True
except ImportError:
HAS_WINSHELL = False
try:
@ -470,6 +470,19 @@ class SSH(object):
self.targets[host][default] = self.defaults[default]
if 'host' not in self.targets[host]:
self.targets[host]['host'] = host
if self.targets[host].get('winrm') and not HAS_WINSHELL:
returned.add(host)
rets.add(host)
log_msg = 'Please contact sales@saltstack.com for access to the enterprise saltwinshell module.'
log.debug(log_msg)
no_ret = {'fun_args': [],
'jid': None,
'return': log_msg,
'retcode': 1,
'fun': '',
'id': host}
yield {host: no_ret}
continue
args = (
que,
self.opts,

View file

@ -5218,9 +5218,14 @@ def copy(
subdir=False,
**kwargs):
'''
If the source file exists on the system, copy it to the named file. The
named file will not be overwritten if it already exists unless the force
option is set to True.
If the file defined by the ``source`` option exists on the minion, copy it
to the named path. The file will not be overwritten if it already exists,
unless the ``force`` option is set to ``True``.
.. note::
This state only copies files from one location on a minion to another
location on the same minion. For copying files from the master, use a
:py:func:`file.managed <salt.states.file.managed>` state.
name
The location of the file to copy to

View file

@ -55,13 +55,13 @@ class PillarTestCase(TestCase):
'renderer_blacklist': [],
'renderer_whitelist': [],
'state_top': '',
'pillar_roots': {'__env__': '/srv/pillar/__env__', 'base': '/srv/pillar/base'},
'file_roots': {'base': '/srv/salt/base', 'dev': '/svr/salt/dev'},
'pillar_roots': {'__env__': ['/srv/pillar/__env__'], 'base': ['/srv/pillar/base']},
'file_roots': {'base': ['/srv/salt/base'], 'dev': ['/svr/salt/dev']},
'extension_modules': '',
}
pillar = salt.pillar.Pillar(opts, {}, 'mocked-minion', 'base', pillarenv='dev')
self.assertEqual(pillar.opts['file_roots'],
{'base': '/srv/pillar/base', 'dev': '/srv/pillar/__env__'})
{'base': ['/srv/pillar/base'], 'dev': ['/srv/pillar/__env__']})
def test_ignored_dynamic_pillarenv(self):
opts = {
@ -69,12 +69,12 @@ class PillarTestCase(TestCase):
'renderer_blacklist': [],
'renderer_whitelist': [],
'state_top': '',
'pillar_roots': {'__env__': '/srv/pillar/__env__', 'base': '/srv/pillar/base'},
'file_roots': {'base': '/srv/salt/base', 'dev': '/svr/salt/dev'},
'pillar_roots': {'__env__': ['/srv/pillar/__env__'], 'base': ['/srv/pillar/base']},
'file_roots': {'base': ['/srv/salt/base'], 'dev': ['/svr/salt/dev']},
'extension_modules': '',
}
pillar = salt.pillar.Pillar(opts, {}, 'mocked-minion', 'base', pillarenv='base')
self.assertEqual(pillar.opts['file_roots'], {'base': '/srv/pillar/base'})
self.assertEqual(pillar.opts['file_roots'], {'base': ['/srv/pillar/base']})
def test_malformed_pillar_sls(self):
with patch('salt.pillar.compile_template') as compile_template: