Merge branch '2017.7' into docs-sphinx-ref-deadlink-fix

This commit is contained in:
Daniel Wozniak 2019-03-05 03:08:36 -07:00 committed by GitHub
commit 92752071c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 57 additions and 19 deletions

View file

@ -251,7 +251,7 @@ on_saltstack = 'SALT_ON_SALTSTACK' in os.environ
project = 'Salt'
version = salt.version.__version__
latest_release = '2018.3.3' # latest release
latest_release = '2018.3.4' # latest release
previous_release = '2017.7.8' # latest release from previous branch
previous_release_dir = '2017.7' # path on web server for previous branch
next_release = '' # next release

View file

@ -340,8 +340,17 @@ Building the documentation
4. A useful method of viewing the HTML documentation locally is to start
Python's built-in HTTP server:
Python 3:
.. code-block:: bash
cd /path/to/salt/doc/_build/html
python3 -m http.server
Python 2:
.. code-block:: bash
cd /path/to/salt/doc/_build/html
python -m SimpleHTTPServer

View file

@ -30,6 +30,10 @@ def _check_zfs():
Looks to see if zfs is present on the system.
'''
# Get the path to the zfs binary.
# Don't try to load this on Windows (#51703)
# Don't merge this forward
if salt.utils.platform.is_windows():
return False, 'ZFS: Not available on Windows'
return salt.utils.which('zfs')

View file

@ -690,8 +690,12 @@ def rr_present(name, HostedZoneId=None, DomainName=None, PrivateZone=False, Name
if locals().get(u) != rrset.get(u):
update = True
break
if ResourceRecords != sorted(rrset.get('ResourceRecords'), key=lambda x: x['Value']):
update = True
if rrset.get('ResourceRecords') is not None:
if ResourceRecords != sorted(rrset.get('ResourceRecords'), key=lambda x: x['Value']):
update = True
elif (AliasTarget is not None) and (rrset.get('AliasTarget') is not None):
if sorted(AliasTarget) != sorted(rrset.get('AliasTarget')):
update = True
if not create and not update:
ret['comment'] = ('Route 53 resource record {} with type {} is already in the desired state.'

View file

@ -609,6 +609,7 @@ def _check_file(name):
def _find_keep_files(root, keep):
'''
Compile a list of valid keep files (and directories).
Used by _clean_dir()
'''
real_keep = set()
real_keep.add(root)
@ -632,6 +633,7 @@ def _clean_dir(root, keep, exclude_pat):
Clean out all of the files and directories in a directory (root) while
preserving the files in a list (keep) and part of exclude_pat
'''
root = os.path.normcase(root)
real_keep = _find_keep_files(root, keep)
removed = set()
@ -2933,7 +2935,7 @@ def directory(name,
perms: full_control
- win_inheritance: False
'''
name = os.path.normcase(os.path.expanduser(name))
name = os.path.expanduser(name)
ret = {'name': name,
'changes': {},
'pchanges': {},
@ -3419,7 +3421,7 @@ def recurse(name,
)
kwargs.pop('env')
name = os.path.normcase(os.path.expanduser(sdecode(name)))
name = os.path.expanduser(sdecode(name))
user = _test_owner(kwargs, user=user)
if salt.utils.is_windows():

View file

@ -55,6 +55,13 @@ def _init_libcrypto():
'''
libcrypto = _load_libcrypto()
try:
libcrypto.OPENSSL_init_crypto()
except AttributeError:
# Support for OpenSSL < 1.1 (OPENSSL_API_COMPAT < 0x10100000L)
libcrypto.OPENSSL_no_config()
libcrypto.OPENSSL_add_all_algorithms_noconf()
libcrypto.RSA_new.argtypes = ()
libcrypto.RSA_new.restype = c_void_p
libcrypto.RSA_free.argtypes = (c_void_p, )
@ -69,13 +76,6 @@ def _init_libcrypto():
libcrypto.RSA_private_encrypt.argtypes = (c_int, c_char_p, c_char_p, c_void_p, c_int)
libcrypto.RSA_public_decrypt.argtypes = (c_int, c_char_p, c_char_p, c_void_p, c_int)
try:
libcrypto.OPENSSL_init_crypto()
except AttributeError:
# Support for OpenSSL < 1.1 (OPENSSL_API_COMPAT < 0x10100000L)
libcrypto.OPENSSL_no_config()
libcrypto.OPENSSL_add_all_algorithms_noconf()
return libcrypto

View file

@ -24,6 +24,16 @@ except ImportError:
log = logging.getLogger(__name__)
__virtualname__ = 'win_update'
def __virtual__():
if not salt.utils.platform.is_windows():
return False, 'win_update: Not available on Windows'
if not HAS_PYWIN32:
return False, 'win_update: Missing pywin32'
return __virtualname__
class Updates(object):
'''

View file

@ -648,14 +648,18 @@ def _fetch_events(q):
atexit.register(_clean_queue)
a_config = AdaptedConfigurationTestCaseMixin()
event = salt.utils.event.get_event('minion', sock_dir=a_config.get_config('minion')['sock_dir'], opts=a_config.get_config('minion'))
event = salt.utils.event.get_event(
'minion',
sock_dir=a_config.get_config('minion')['sock_dir'],
opts=a_config.get_config('minion'),
)
while True:
try:
events = event.get_event(full=False)
except Exception:
except Exception as exc:
# This is broad but we'll see all kinds of issues right now
# if we drop the proc out from under the socket while we're reading
pass
log.exception("Exception caught while getting events %r", exc)
q.put(events)

View file

@ -1930,15 +1930,20 @@ class TestFindKeepFiles(TestCase):
@skipIf(not salt.utils.is_windows(), 'Only run on Windows')
def test__find_keep_files_win32(self):
'''
Test _find_keep_files. The `_find_keep_files` function is only called by
_clean_dir, so case doesn't matter. Should return all lower case.
'''
keep = filestate._find_keep_files(
'c:\\test\\parent_folder',
['C:\\test\\parent_folder\\meh-2.txt']
['C:\\test\\parent_folder\\meh-1.txt',
'C:\\Test\\Parent_folder\\Meh-2.txt']
)
expected = [
'c:\\',
'c:\\test',
'c:\\test\\parent_folder',
'c:\\test\\parent_folder\\meh-2.txt'
]
'c:\\test\\parent_folder\\meh-1.txt',
'c:\\test\\parent_folder\\meh-2.txt']
actual = sorted(list(keep))
assert actual == expected, actual
self.assertListEqual(actual, expected)