Merge pull request #45551 from rallytime/merge-2017.7

[2017.7] Merge forward from 2016.11 to 2017.7
This commit is contained in:
Nicole Thomas 2018-01-19 13:21:26 -05:00 committed by GitHub
commit 879cfcb889
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 46 deletions

View File

@ -103,8 +103,8 @@ RedHat Pygit2 Issues
The release of RedHat/CentOS 7.3 upgraded both ``python-cffi`` and
``http-parser``, both of which are dependencies for pygit2_/libgit2_. Both
pygit2_ and libgit2_ (which are from the EPEL repository and not managed
directly by RedHat) need to be rebuilt against these updated dependencies.
``pygit2`` and ``libgit2`` packages (which are from the EPEL repository) should
be upgraded to the most recent versions, at least to ``0.24.2``.
The below errors will show up in the master log if an incompatible
``python-pygit2`` package is installed:
@ -123,30 +123,8 @@ package is installed:
2017-02-15 18:04:45,211 [salt.utils.gitfs ][ERROR ][6211] Error occurred fetching gitfs remote 'https://foo.com/bar.git': No Content-Type header in response
As of 15 February 2017, ``python-pygit2`` has been rebuilt and is in the stable
EPEL repository. However, ``libgit2`` remains broken (a `bug report`_ has been
filed to get it rebuilt).
In the meantime, you can work around this by downgrading ``http-parser``. To do
this, go to `this page`_ and download the appropriate ``http-parser`` RPM for
the OS architecture you are using (x86_64, etc.). Then downgrade using the
``rpm`` command. For example:
.. code-block:: bash
[root@784e8a8c5028 /]# curl --silent -O https://kojipkgs.fedoraproject.org//packages/http-parser/2.0/5.20121128gitcd01361.el7/x86_64/http-parser-2.0-5.20121128gitcd01361.el7.x86_64.rpm
[root@784e8a8c5028 /]# rpm -Uvh --oldpackage http-parser-2.0-5.20121128gitcd01361.el7.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:http-parser-2.0-5.20121128gitcd01################################# [ 50%]
Cleaning up / removing...
2:http-parser-2.7.1-3.el7 ################################# [100%]
A restart of the salt-master daemon may be required to allow http(s)
repositories to continue to be fetched.
.. _`this page`: https://koji.fedoraproject.org/koji/buildinfo?buildID=703753
.. _`bug report`: https://bugzilla.redhat.com/show_bug.cgi?id=1422583
A restart of the ``salt-master`` daemon and gitfs cache directory clean up may
be required to allow http(s) repositories to continue to be fetched.
GitPython

View File

@ -111,7 +111,7 @@ def __init__(opts):
a few env variables to keep apt happy and
non-interactive.
'''
if __virtual__():
if __virtual__() == __virtualname__:
# Export these puppies so they persist
os.environ.update(DPKG_ENV_VARS)

View File

@ -829,9 +829,9 @@ def genrepo(**kwargs):
def _repo_process_pkg_sls(filename, short_path_name, ret, successful_verbose):
renderers = salt.loader.render(__opts__, __salt__)
def _failed_compile(msg):
log.error(msg)
ret.setdefault('errors', {})[short_path_name] = [msg]
def _failed_compile(prefix_msg, error_msg):
log.error('{0} \'{1}\': {2} '.format(prefix_msg, short_path_name, error_msg))
ret.setdefault('errors', {})[short_path_name] = ['{0}, {1} '.format(prefix_msg, error_msg)]
return False
try:
@ -842,13 +842,11 @@ def _repo_process_pkg_sls(filename, short_path_name, ret, successful_verbose):
__opts__.get('renderer_blacklist', ''),
__opts__.get('renderer_whitelist', ''))
except SaltRenderError as exc:
msg = 'Failed to compile \'{0}\': {1}'.format(short_path_name, exc)
return _failed_compile(msg)
return _failed_compile('Failed to compile', exc)
except Exception as exc:
msg = 'Failed to read \'{0}\': {1}'.format(short_path_name, exc)
return _failed_compile(msg)
return _failed_compile('Failed to read', exc)
if config:
if config and isinstance(config, dict):
revmap = {}
errors = []
for pkgname, version_list in six.iteritems(config):
@ -890,6 +888,8 @@ def _repo_process_pkg_sls(filename, short_path_name, ret, successful_verbose):
ret.setdefault('repo', {}).update(config)
ret.setdefault('name_map', {}).update(revmap)
successful_verbose[short_path_name] = config.keys()
elif config:
return _failed_compile('Compiled contents', 'not a dictionary/hash')
else:
log.debug('No data within \'%s\' after processing', short_path_name)
# no pkgname found after render

View File

@ -47,7 +47,7 @@ class PipModuleTest(ModuleCase):
'''
return any(w in ret for w in ['URLError', 'Download error'])
def pip_successful_install(self, target, expect=('flake8', 'pep8',)):
def pip_successful_install(self, target, expect=('tox', 'pep8',)):
'''
isolate regex for extracting `successful install` message from pip
'''
@ -102,7 +102,7 @@ class PipModuleTest(ModuleCase):
with salt.utils.fopen(req1_filename, 'w') as f:
f.write('-r requirements1b.txt\n')
with salt.utils.fopen(req1b_filename, 'w') as f:
f.write('flake8\n')
f.write('tox\n')
with salt.utils.fopen(req2_filename, 'w') as f:
f.write('-r requirements2b.txt\n')
with salt.utils.fopen(req2b_filename, 'w') as f:
@ -140,7 +140,7 @@ class PipModuleTest(ModuleCase):
with salt.utils.fopen(req1_filename, 'w') as f:
f.write('-r requirements1b.txt\n')
with salt.utils.fopen(req1b_filename, 'w') as f:
f.write('flake8\n')
f.write('tox\n')
with salt.utils.fopen(req2_filename, 'w') as f:
f.write('-r requirements2b.txt\n')
with salt.utils.fopen(req2b_filename, 'w') as f:
@ -173,7 +173,7 @@ class PipModuleTest(ModuleCase):
req2_filename = os.path.join(self.venv_dir, 'requirements2.txt')
with salt.utils.fopen(req1_filename, 'w') as f:
f.write('flake8\n')
f.write('tox\n')
with salt.utils.fopen(req2_filename, 'w') as f:
f.write('pep8\n')
@ -210,7 +210,7 @@ class PipModuleTest(ModuleCase):
req2_filepath = os.path.join(req_cwd, req2_filename)
with salt.utils.fopen(req1_filepath, 'w') as f:
f.write('flake8\n')
f.write('tox\n')
with salt.utils.fopen(req2_filepath, 'w') as f:
f.write('pep8\n')

View File

@ -254,10 +254,10 @@ class PkgModuleTest(ModuleCase, SaltReturnAssertsMixin):
self.assertIn('bash-completion', keys)
self.assertIn('dpkg', keys)
elif os_family == 'RedHat':
ret = self.run_function(func, ['rpm', 'yum'])
ret = self.run_function(func, ['rpm', 'bash'])
keys = ret.keys()
self.assertIn('rpm', keys)
self.assertIn('yum', keys)
self.assertIn('bash', keys)
elif os_family == 'Suse':
ret = self.run_function(func, ['less', 'zypper'])
keys = ret.keys()

View File

@ -493,10 +493,11 @@ PATCHLEVEL = 3
log.debug(
'Testing Docker cgroup substring \'%s\'', cgroup_substr)
with patch('salt.utils.fopen', mock_open(read_data=cgroup_data)):
self.assertEqual(
core._virtual({'kernel': 'Linux'}).get('virtual_subtype'),
'Docker'
)
with patch.dict(core.__salt__, {'cmd.run_all': MagicMock()}):
self.assertEqual(
core._virtual({'kernel': 'Linux'}).get('virtual_subtype'),
'Docker'
)
def _check_ipaddress(self, value, ip_v):
'''