Merge pull request #36635 from rallytime/merge-2016.3

[2016.3] Merge forward from 2015.8 to 2016.3
This commit is contained in:
Nicole Thomas 2016-09-28 15:10:25 -06:00 committed by GitHub
commit 6d9b28506c
6 changed files with 31 additions and 0 deletions

View file

@ -994,3 +994,10 @@
############################################
# Default match type for filtering events tags: startswith, endswith, find, regex, fnmatch
#event_match_type: startswith
# Permanently include any available Python 3rd party modules into Salt Thin
# when they are generated for Salt-SSH or other purposes.
# The modules should be named by the names they are actually imported inside the Python.
# The value of the parameters can be either one module or a comma separated list of them.
#thin_extra_mods: foo,bar

View file

@ -722,6 +722,15 @@ overridden on a per-minion basis in the roster (``minion_opts``)
minion_opts:
gpg_keydir: /root/gpg
``thin_extra_mods``
-------------------
Default: None
List of additional modules, needed to be included into the Salt Thin.
Pass a list of importable Python modules that are typically located in
the `site-packages` Python directory so they will be also always included
into the Salt Thin, once generated.
Master Security Settings
========================

View file

@ -295,6 +295,7 @@ class SSH(object):
self.returners = salt.loader.returners(self.opts, {})
self.fsclient = salt.fileclient.FSClient(self.opts)
self.thin = salt.utils.thin.gen_thin(self.opts['cachedir'],
extra_mods=self.opts.get('thin_extra_mods'),
python2_bin=self.opts['python2_bin'],
python3_bin=self.opts['python3_bin'])
self.mods = mod_data(self.fsclient)

View file

@ -859,6 +859,9 @@ VALID_OPTS = {
#
# Default to False for 2016.3 and Carbon. Switch to True for Nitrogen
'proxy_merge_grains_in_module': bool,
# Extra modules for Salt Thin
'thin_extra_mods': str,
}
# default configurations
@ -1340,6 +1343,7 @@ DEFAULT_MASTER_OPTS = {
'http_max_body': 100 * 1024 * 1024 * 1024, # 100GB
'python2_bin': 'python2',
'python3_bin': 'python3',
'thin_extra_mods': '',
}

View file

@ -31,6 +31,10 @@ def generate(extra_mods='', overwrite=False, so_mods='',
salt-run thin.generate mako,wempy 1
salt-run thin.generate overwrite=1
'''
conf_mods = __opts__.get('thin_extra_mods')
if conf_mods:
extra_mods = ','.join([conf_mods, extra_mods])
return salt.utils.thin.gen_thin(__opts__['cachedir'],
extra_mods,
overwrite,

View file

@ -2727,6 +2727,12 @@ class SaltSSHOptionParser(six.with_metaclass(OptionParserMeta,
default=None,
help='Pass in extra files to include in the state tarball.'
)
self.add_option(
'--thin-extra-modules',
dest='thin_extra_mods',
default=None,
help='One or comma-separated list of extra Python modules'
'to be included into Thin Salt.')
self.add_option(
'-v', '--verbose',
default=False,