Merge pull request #33381 from rallytime/merge-2015.8

[2015.8] Merge forward from 2015.5 to 2015.8
This commit is contained in:
Nicole Thomas 2016-05-20 09:58:11 -06:00
commit 91059224f6
3 changed files with 19 additions and 10 deletions

View file

@ -780,11 +780,15 @@ Minion Module Management
Default: ``[]`` (all modules are enabled by default)
The event may occur in which the administrator desires that a minion should not
be able to execute a certain module. The sys module is built into the minion
be able to execute a certain module. The ``sys`` module is built into the minion
and cannot be disabled.
This setting can also tune the minion, as all modules are loaded into ram
disabling modules will lower the minion's ram footprint.
This setting can also tune the minion. Because all modules are loaded into system
memory, disabling modules will lover the minion's memory footprint.
Modules should be specified according to their file name on the system and not by
their virtual name. For example, to disable ``cmd``, use the string ``cmdmod`` which
corresponds to ``salt.modules.cmdmod``.
.. code-block:: yaml

View file

@ -9,6 +9,7 @@ from __future__ import absolute_import
import logging
import warnings
from yaml.scanner import ScannerError
from yaml.parser import ParserError
from yaml.constructor import ConstructorError
# Import salt libs
@ -53,7 +54,7 @@ def render(yaml_data, saltenv='base', sls='', argline='', **kws):
err_type = _ERROR_MAP.get(exc.problem, exc.problem)
line_num = exc.problem_mark.line + 1
raise SaltRenderError(err_type, line_num, exc.problem_mark.buffer)
except ConstructorError as exc:
except (ParserError, ConstructorError) as exc:
raise SaltRenderError(exc)
if len(warn_list) > 0:
for item in warn_list:

View file

@ -174,12 +174,16 @@ def _check_pkg_version_format(pkg):
ret['version_spec'] = []
else:
ret['result'] = True
ret['prefix'] = re.sub('[^A-Za-z0-9.]+', '-', install_req.name)
if hasattr(install_req, "specifier"):
specifier = install_req.specifier
else:
specifier = install_req.req.specifier
ret['version_spec'] = [(spec.operator, spec.version) for spec in specifier]
try:
ret['prefix'] = install_req.req.project_name
ret['version_spec'] = install_req.req.specs
except Exception:
ret['prefix'] = re.sub('[^A-Za-z0-9.]+', '-', install_req.name)
if hasattr(install_req, "specifier"):
specifier = install_req.specifier
else:
specifier = install_req.req.specifier
ret['version_spec'] = [(spec.operator, spec.version) for spec in specifier]
return ret