Commit graph

36 commits

Author SHA1 Message Date
Erik Johnson
002aa88a97
Replace yaml usage with a helper to ensure unicode is handled properly
Without allow_unicode=True, unicode characters are processed through the
str representer and on Python 2 are dumped as a Unicode code point (i.e.
a literal \u0414). This commit makes allow_unicode=True the default in
our salt.utils.yamlloader.safe_dump() helper. It also adds a new
salt.utils.yamlloader.dump() helper which wraps yaml.dump() and also
makes allow_unicode=True the default.

To make importing and using our custom yaml loader/dumper easier, a
convenience module called salt.utils.yaml has been added, which does a
wildcard import from both salt.utils.yamldumper and
salt.utils.yamlloader.

Refs to yaml.load/dump and yaml.safe_load/safe_dump have been updated to
salt.utils.yaml, to ensure that unicode is handled properly.
2018-01-03 14:14:21 -06:00
Gareth J. Greenaway
2ba749e841
Updating some formatting. 2017-10-16 14:38:32 -07:00
Gareth J. Greenaway
00063e8fc7
Updating error messages to be more clear when beacons are configured in pillar. Updating the list to ensure the parameters are clear. 2017-10-16 14:32:12 -07:00
Gareth J. Greenaway
2738a124fe
Some cleanup of duplicated code. Fixing event comments. 2017-10-16 14:32:12 -07:00
Gareth J. Greenaway
a89c26c88e
Various fixes to beacons to handle situations when beacons are stored in pillar. Updating execution module to report that beacons stored in pillar can not be managed via module. Updating add function to ensure beacon is available before attempting to add it. Updaitng unit tests to include new beacon is available check. 2017-10-16 14:32:12 -07:00
Gareth J. Greenaway
d0307ff070 Fixing lint issues 2017-08-24 10:24:27 -07:00
Gareth J. Greenaway
ba7e92c113 Swapping out the first item list for the iterated item. 2017-08-24 10:24:27 -07:00
Gareth J. Greenaway
803247f842 Adding list_available to show loaded & available beacons on the minion. Swapping out the way we validate beacon configuration to be able to support adding & modifying custom beacons. 2017-08-24 10:24:27 -07:00
Gareth J. Greenaway
d5abd98406 tweaking to be able to use beacon module & state module to manage custom beacons 2017-08-24 10:24:27 -07:00
Gareth J. Greenaway
474b6dbdf8 Updating various documentation and beacons. Adding unit tests for the beacon module. 2017-08-14 12:04:38 -07:00
rallytime
ccf790a83f Update all references for moved functions to use "files" util
- fopen
- flopen
- fpopen
- safe_rm
- is_empty
- is_fcntl_available
2017-07-18 10:31:01 -06:00
rallytime
97a36ef367 Avoid UnboundLocalError in beacons module
Also import the correct salt.utils.event lib (not just salt.utils)
2016-07-25 14:27:26 -06:00
Nicole Thomas
f9ffcb697a [2016.3] Merge forward from 2015.8 to 2016.3 (#32784)
* json encode arguments passed to an execution module function call

this fixes problems where you could pass a string to a module function,
which thanks to the yaml decoder which is used when parsing command line
arguments could change its type entirely. for example:

__salt__['test.echo')('{foo: bar}')

the test.echo function just returns the argument it's given. however,
because it's being called through a salt-call process like this:

salt-call --local test.echo {foo: bar}

salt thinks it's yaml and therefore yaml decodes it. the return value
from the test.echo call above is therefore a dict, not a string.

* Prevent crash if pygit2 package is requesting re-compilation of the e… (#32652)

* Prevent crash if pygit2 package is requesting re-compilation of the entire library on production systems (no *devel packages)

* Fix PEP8: move imports to the top of the file

* Move logger up

* Add log error message in case if exception is not an ImportError

* align OS grains from older SLES with current one (#32649)

* Fixing critical bug to remove only the specified Host instead of the entire Host cluster (#32640)

* yumpkg: Ignore epoch in version comparison for explict versions without an epoch (#32563)

* yumpkg: Ignore epoch in version comparison for explict versions without an epoch

Also properly handle comparisions for packages with multiple versions.

Resolves #32229

* Don't attempt downgrade for kernel and its subpackages

Multiple versions are supported since their paths do not conflict.

* Lower log level for pillar cache (#32655)

This shouldn't show up on salt-call runs

* Don't access deprecated Exception.message attribute. (#32556)

* Don't access deprecated Exception.message attribute.

To avoid a deprecation warning message in logs.
There is a new function salt.exceptions.get_error_message(e) instead.

* Fixed module docs test.

* Fix for issue 32523 (#32672)

* Fix routes for redhat < 6

* Handle a couple of arguments better (Azure) (#32683)

* backporting a fix from develop where the use of splay would result in seconds=0 in the schedule.list when there was no seconds specified in the origina schedule

* Handle when beacon not configured and we try to enable/disable them (#32692)

* Handle the situation when the beacon is not configured and we try to disable it

* a couple more missing returns in the enable & disable

* Check dependencies type before appling str operations (#32693)

* Update external auth documentation to list supported matcher. (#32733)

Thanks to #31598, all matchers are supported for eauth configuration.
But we still have no way to use compound matchers in eauth configuration.
Update the documentation to explicitly express this limitation.

* modules.win_dacl: consistent case of dacl constants (#32720)

* Document pillar cache options (#32643)

* Add note about Pillar data cache requirement for Pillar targeting method

* Add `saltutil.refresh_pillar` function to the scheduled Minion jobs

* Minor fixes in docs

* Add note about relations between `pillar_cache` option and Pillar Targeting
to Master config comments with small reformatting

* Document Pillar Cache Options for Salt Master

* Document Minions Targeting with Mine

* Remove `saltutil.refresh_pillar` scheduled persistent job

* Properly handle minion failback failure. (#32749)

* Properly handle minion failback failure.

Initiate minion restart if all masters down on __master_disconnect like
minion does on the initial master connect on start.

* Fixed unit test

* Improve documentation on pygit2 versions (#32779)

This adds an explanation of the python-cffi dep added in pygit2 0.21.0,
and recommends 0.20.3 for LTS distros. It also links to the salt-pack
issue which tracks the progress of adding pygit2 to our Debian and
Ubuntu repositories.

* Pylint fix
2016-04-25 15:26:09 -06:00
rallytime
7ea9dacbdd Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/beacons/inotify.py
  - salt/beacons/load.py
  - salt/minion.py
  - salt/modules/win_update.py
  - salt/modules/yumpkg.py
  - salt/utils/pkg/rpm.py
2016-02-18 11:10:44 -07:00
Gareth J. Greenaway
91b14dca40 fixing the beacon module and state module to handle passing enabled properly. Also reworking how what is returned from the validating functions is handled to ensure when beacon configurations aren't validate the results indicate exactly why. 2016-02-11 22:06:01 -08:00
Megan Kearl
7f0a89be23 Fix pep8 whitespace errors 2015-11-18 20:46:20 -06:00
Megan Kearl
f6c30a78ea Fix Python 3 incompatibilities 2015-11-18 20:10:36 -06:00
makearl
5920f2a311 Fix logic issue and inconsistent success message 2015-11-18 16:34:11 -06:00
makearl
fe53009d18 Merge branch 'develop' of https://github.com/makearl/salt into issue-28796-beacon-config-as-list
# Conflicts:
#	salt/beacons/__init__.py
2015-11-18 14:27:39 -06:00
makearl
9ccd0b2d4c Add support for beacon config as a list 2015-11-18 09:20:23 -06:00
Mike Place
8e70e88488 Merge pull request #28798 from makearl/fix-cli-doc-beacons-modify
Fix typo in beacons.modify CLI example
2015-11-11 22:05:53 -07:00
makearl
795379219f Fixing typo in beacons.modify CLI example 2015-11-11 16:38:59 -06:00
Nathan W
30e6b055ec Small documentation error fixed 2015-10-13 16:44:31 -06:00
Nathan W
874e1307dc Small documentation error fixed 2015-10-13 13:03:25 -05:00
rallytime
b24911a3e1 More Beryllium --> 2015.8.0 version reference changes 2015-07-08 10:57:43 -06:00
Gareth J. Greenaway
8aa58612ed lint 2015-05-22 15:27:17 -07:00
Gareth J. Greenaway
142c4864b8 Adding some additional documentation to state and execution modules. 2015-05-22 10:31:17 -07:00
Gareth J. Greenaway
4f0e50a758 Adding a state module to manage beacons. adding a new method to the beacon execution module to modify existing beacons. 2015-05-20 21:04:41 -07:00
Gareth J. Greenaway
5d60c0ff22 switching the list function in the beacon execution module to use an event to retrieve the list of beacons to ensure consistency when using salt vs salt-call 2015-05-19 11:13:32 -07:00
Gareth J. Greenaway
66b86a0ae4 adding code to allow enabling and disabling specific beacons. 2015-05-12 08:56:48 -07:00
Gareth J. Greenaway
d9ca60aa0c lint fixes. 2015-05-10 20:45:14 -07:00
Gareth J. Greenaway
2cffd7572e Additions to beacons execution module to allow enabling, disabling and saving beacons. 2015-05-09 17:16:53 -07:00
Gareth J. Greenaway
3f19ebb0dc Lint fixes 2015-04-17 19:42:09 -07:00
Gareth J. Greenaway
6ce0af05d5 Moving code in the add method into the else section of the if...else clause. Adding check in the delete method that the beacon was really deleted. 2015-04-17 19:00:29 -07:00
Gareth J. Greenaway
371643f9d4 Fixing versionadded tag. 2015-04-17 15:40:54 -07:00
Gareth J. Greenaway
98155497af Adding beacons module. 2015-04-17 15:15:31 -07:00