Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add execution module for working in sls files #30532

Merged
merged 2 commits into from
Jan 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/ref/modules/all/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ Full list of builtin execution modules
service
shadow
slack_notify
slsutil
smartos_imgadm
smartos_virt
smartos_vmadm
Expand Down
35 changes: 35 additions & 0 deletions salt/modules/slsutil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
'''
Utility functions for use with or in SLS files
'''
from __future__ import absolute_import

from salt.utils.dictupdate import merge, update

update.__doc__ = update.__doc__ + '''\

CLI Example:

.. code-block:: shell

salt '*' slsutil.update '{foo: Foo}' '{bar: Bar}'

'''

merge.__doc__ = '''\
Merge a data structure into another by choosing a merge strategy

Strategies:

* aggregate
* list
* overwrite
* recurse
* smart

CLI Example:

.. code-block:: shell

salt '*' slsutil.merge '{foo: Foo}' '{bar: Bar}'
'''