mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix more docstring formatting issues
This commit is contained in:
parent
b1fa9c2054
commit
ac9ff945d3
17 changed files with 52 additions and 48 deletions
|
@ -55,7 +55,7 @@ the master, the syntax looks like this:
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
# salt '*' cp.get_file salt://vimrc /etc/vimrc
|
||||
salt '*' cp.get_file salt://vimrc /etc/vimrc
|
||||
|
||||
This will instruct all Salt minions to download the vimrc file and copy it
|
||||
to /etc/vimrc
|
||||
|
@ -65,7 +65,7 @@ like so:
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
# salt '*' cp.get_file "salt://{{grains.os}}/vimrc" /etc/vimrc template=jinja
|
||||
salt '*' cp.get_file "salt://{{grains.os}}/vimrc" /etc/vimrc template=jinja
|
||||
|
||||
This example would instruct all Salt minions to download the vimrc from a
|
||||
directory with the same name as their OS grain and copy it to /etc/vimrc
|
||||
|
@ -81,7 +81,7 @@ words, 1 uses the least CPU on the master (and minion), while 9 uses the most.
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
# salt '*' cp.get_file salt://vimrc /etc/vimrc gzip=5
|
||||
salt '*' cp.get_file salt://vimrc /etc/vimrc gzip=5
|
||||
|
||||
Finally, note that by default cp.get_file does *not* create new destination
|
||||
directories if they do not exist. To change this, use the ``makedirs``
|
||||
|
@ -89,7 +89,7 @@ argument:
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
# salt '*' cp.get_file salt://vimrc /etc/vim/vimrc makedirs=True
|
||||
salt '*' cp.get_file salt://vimrc /etc/vim/vimrc makedirs=True
|
||||
|
||||
In this example, /etc/vim/ would be created if it didn't already exist.
|
||||
|
||||
|
@ -101,14 +101,14 @@ directory from the master. The syntax is very similar to get_file:
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
# salt '*' cp.get_dir salt://etc/apache2 /etc
|
||||
salt '*' cp.get_dir salt://etc/apache2 /etc
|
||||
|
||||
cp.get_dir supports template rendering and gzip compression arguments just like
|
||||
get_file:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# salt '*' cp.get_dir salt://etc/{{pillar.webserver}} /etc gzip=5 template=jinja
|
||||
salt '*' cp.get_dir salt://etc/{{pillar.webserver}} /etc gzip=5 template=jinja
|
||||
|
||||
|
||||
File Server Client Instance
|
||||
|
|
|
@ -118,7 +118,7 @@ such as Google Storage, S3 and OpenStack Swift
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' libcloud_storage.download_object DeploymentTools test.sh /tmp/test.sh google_storage
|
||||
salt '*' libcloud_storage.download_object DeploymentTools test.sh /tmp/test.sh google_storage
|
||||
|
||||
Using the state modules
|
||||
=======================
|
||||
|
|
|
@ -451,7 +451,6 @@ def cql_query_with_prepare(
|
|||
:return: A dictionary from the return values of the query
|
||||
:rtype: list[dict]
|
||||
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
|
|
@ -50,7 +50,6 @@ def run_task(
|
|||
"""
|
||||
Execute celery tasks. For celery specific parameters see celery documentation.
|
||||
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
|
|
@ -217,7 +217,7 @@ def ex_mod_init(low):
|
|||
.. versionadded:: 0.17.0
|
||||
Initial automatic enforcement added when pkg is used on a Gentoo system.
|
||||
|
||||
.. versionchanged:: 2014.1.0-Hydrogen
|
||||
.. versionchanged:: 2014.7.0
|
||||
Configure option added to make this behaviour optional, defaulting to
|
||||
off.
|
||||
|
||||
|
|
|
@ -377,7 +377,6 @@ def delete_stack(name=None, poll=0, timeout=60, profile=None):
|
|||
profile
|
||||
Profile to use
|
||||
|
||||
|
||||
CLI Examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
|
|
@ -429,7 +429,7 @@ def authenticate(remote_addr, password, cert, key, verify_cert=True):
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.authenticate https://srv01:8443 <yourpass> ~/.config/lxc/client.crt ~/.config/lxc/client.key false
|
||||
salt '*' lxd.authenticate https://srv01:8443 <yourpass> ~/.config/lxc/client.crt ~/.config/lxc/client.key false
|
||||
|
||||
See the `requests-docs`_ for the SSL stuff.
|
||||
|
||||
|
@ -1982,8 +1982,8 @@ def profile_create(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.profile_create autostart config="{boot.autostart: 1, boot.autostart.delay: 2, boot.autostart.priority: 1}"
|
||||
$ salt '*' lxd.profile_create shared_mounts devices="{shared_mount: {type: 'disk', source: '/home/shared', path: '/home/shared'}}"
|
||||
salt '*' lxd.profile_create autostart config="{boot.autostart: 1, boot.autostart.delay: 2, boot.autostart.priority: 1}"
|
||||
salt '*' lxd.profile_create shared_mounts devices="{shared_mount: {type: 'disk', source: '/home/shared', path: '/home/shared'}}"
|
||||
|
||||
See the `lxd-docs`_ for the details about the config and devices dicts.
|
||||
|
||||
|
@ -2045,7 +2045,7 @@ def profile_get(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.profile_get autostart
|
||||
salt '*' lxd.profile_get autostart
|
||||
"""
|
||||
client = pylxd_client_get(remote_addr, cert, key, verify_cert)
|
||||
|
||||
|
@ -2096,7 +2096,7 @@ def profile_delete(name, remote_addr=None, cert=None, key=None, verify_cert=True
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.profile_delete shared_mounts
|
||||
salt '*' lxd.profile_delete shared_mounts
|
||||
"""
|
||||
profile = profile_get(name, remote_addr, cert, key, verify_cert, _raw=True)
|
||||
|
||||
|
@ -2144,7 +2144,7 @@ def profile_config_get(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.profile_config_get autostart boot.autostart
|
||||
salt '*' lxd.profile_config_get autostart boot.autostart
|
||||
"""
|
||||
profile = profile_get(name, remote_addr, cert, key, verify_cert, _raw=True)
|
||||
|
||||
|
@ -2200,7 +2200,7 @@ def profile_config_set(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.profile_config_set autostart boot.autostart 0
|
||||
salt '*' lxd.profile_config_set autostart boot.autostart 0
|
||||
"""
|
||||
profile = profile_get(name, remote_addr, cert, key, verify_cert, _raw=True)
|
||||
|
||||
|
@ -2247,7 +2247,7 @@ def profile_config_delete(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.profile_config_delete autostart boot.autostart.delay
|
||||
salt '*' lxd.profile_config_delete autostart boot.autostart.delay
|
||||
"""
|
||||
profile = profile_get(name, remote_addr, cert, key, verify_cert, _raw=True)
|
||||
|
||||
|
@ -2294,7 +2294,7 @@ def profile_device_get(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.profile_device_get default eth0
|
||||
salt '*' lxd.profile_device_get default eth0
|
||||
"""
|
||||
profile = profile_get(name, remote_addr, cert, key, verify_cert, _raw=True)
|
||||
|
||||
|
@ -2348,7 +2348,7 @@ def profile_device_set(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.profile_device_set autostart eth1 nic nictype=bridged parent=lxdbr0
|
||||
salt '*' lxd.profile_device_set autostart eth1 nic nictype=bridged parent=lxdbr0
|
||||
"""
|
||||
profile = profile_get(name, remote_addr, cert, key, verify_cert, _raw=True)
|
||||
|
||||
|
@ -2400,7 +2400,7 @@ def profile_device_delete(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.profile_device_delete autostart eth1
|
||||
salt '*' lxd.profile_device_delete autostart eth1
|
||||
|
||||
"""
|
||||
profile = profile_get(name, remote_addr, cert, key, verify_cert, _raw=True)
|
||||
|
@ -2450,8 +2450,8 @@ def image_list(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.image_list true --out=json
|
||||
$ salt '*' lxd.image_list --out=json
|
||||
salt '*' lxd.image_list true --out=json
|
||||
salt '*' lxd.image_list --out=json
|
||||
"""
|
||||
client = pylxd_client_get(remote_addr, cert, key, verify_cert)
|
||||
|
||||
|
@ -2560,7 +2560,7 @@ def image_get_by_alias(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.image_get_by_alias xenial/amd64
|
||||
salt '*' lxd.image_get_by_alias xenial/amd64
|
||||
"""
|
||||
client = pylxd_client_get(remote_addr, cert, key, verify_cert)
|
||||
|
||||
|
@ -2612,7 +2612,7 @@ def image_delete(image, remote_addr=None, cert=None, key=None, verify_cert=True)
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.image_delete xenial/amd64
|
||||
salt '*' lxd.image_delete xenial/amd64
|
||||
"""
|
||||
|
||||
image = _verify_image(image, remote_addr, cert, key, verify_cert)
|
||||
|
@ -2682,7 +2682,7 @@ def image_from_simplestreams(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.image_from_simplestreams "https://cloud-images.ubuntu.com/releases" "trusty/amd64" aliases='["t", "trusty/amd64"]' auto_update=True
|
||||
salt '*' lxd.image_from_simplestreams "https://cloud-images.ubuntu.com/releases" "trusty/amd64" aliases='["t", "trusty/amd64"]' auto_update=True
|
||||
"""
|
||||
if aliases is None:
|
||||
aliases = []
|
||||
|
@ -2763,7 +2763,7 @@ def image_from_url(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.image_from_url https://dl.stgraber.org/lxd aliases='["busybox-amd64"]'
|
||||
salt '*' lxd.image_from_url https://dl.stgraber.org/lxd aliases='["busybox-amd64"]'
|
||||
"""
|
||||
if aliases is None:
|
||||
aliases = []
|
||||
|
@ -2844,7 +2844,7 @@ def image_from_file(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.image_from_file salt://lxd/files/busybox.tar.xz aliases=["busybox-amd64"]
|
||||
salt '*' lxd.image_from_file salt://lxd/files/busybox.tar.xz aliases=["busybox-amd64"]
|
||||
"""
|
||||
if aliases is None:
|
||||
aliases = []
|
||||
|
@ -2953,7 +2953,7 @@ def image_copy_lxd(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.image_copy_lxd xenial/amd64 https://srv01:8443 ~/.config/lxc/client.crt ~/.config/lxc/client.key false https://srv02:8443 ~/.config/lxc/client.crt ~/.config/lxc/client.key false aliases="['xenial/amd64']"
|
||||
salt '*' lxd.image_copy_lxd xenial/amd64 https://srv01:8443 ~/.config/lxc/client.crt ~/.config/lxc/client.key false https://srv02:8443 ~/.config/lxc/client.crt ~/.config/lxc/client.key false aliases="['xenial/amd64']"
|
||||
"""
|
||||
if aliases is None:
|
||||
aliases = []
|
||||
|
@ -3044,7 +3044,7 @@ def image_alias_add(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.image_alias_add xenial/amd64 x "Short version of xenial/amd64"
|
||||
salt '*' lxd.image_alias_add xenial/amd64 x "Short version of xenial/amd64"
|
||||
"""
|
||||
image = _verify_image(image, remote_addr, cert, key, verify_cert)
|
||||
|
||||
|
@ -3096,7 +3096,7 @@ def image_alias_delete(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.image_alias_add xenial/amd64 x "Short version of xenial/amd64"
|
||||
salt '*' lxd.image_alias_add xenial/amd64 x "Short version of xenial/amd64"
|
||||
"""
|
||||
image = _verify_image(image, remote_addr, cert, key, verify_cert)
|
||||
|
||||
|
@ -3147,7 +3147,7 @@ def snapshots_all(container, remote_addr=None, cert=None, key=None, verify_cert=
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.snapshots_all test-container
|
||||
salt '*' lxd.snapshots_all test-container
|
||||
"""
|
||||
containers = container_get(
|
||||
container, remote_addr, cert, key, verify_cert, _raw=True
|
||||
|
@ -3200,7 +3200,7 @@ def snapshots_create(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.snapshots_create test-container test-snapshot
|
||||
salt '*' lxd.snapshots_create test-container test-snapshot
|
||||
"""
|
||||
cont = container_get(container, remote_addr, cert, key, verify_cert, _raw=True)
|
||||
if not name:
|
||||
|
@ -3254,7 +3254,7 @@ def snapshots_delete(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.snapshots_delete test-container test-snapshot
|
||||
salt '*' lxd.snapshots_delete test-container test-snapshot
|
||||
"""
|
||||
cont = container_get(container, remote_addr, cert, key, verify_cert, _raw=True)
|
||||
|
||||
|
@ -3308,7 +3308,7 @@ def snapshots_get(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' lxd.snapshots_get test-container test-snapshot
|
||||
salt '*' lxd.snapshots_get test-container test-snapshot
|
||||
"""
|
||||
container = container_get(container, remote_addr, cert, key, verify_cert, _raw=True)
|
||||
return container.snapshots.get(name)
|
||||
|
|
|
@ -165,7 +165,7 @@ def send(
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ salt '*' mandrill.send message="{'subject': 'Hi', 'from_email': 'test@example.com', 'to': [{'email': 'recv@example.com', 'type': 'to'}]}"
|
||||
salt '*' mandrill.send message="{'subject': 'Hi', 'from_email': 'test@example.com', 'to': [{'email': 'recv@example.com', 'type': 'to'}]}"
|
||||
|
||||
``message`` structure example (as YAML for readability):
|
||||
|
||||
|
|
|
@ -523,6 +523,8 @@ def show(name):
|
|||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' service.show <service name>
|
||||
"""
|
||||
ret = {}
|
||||
|
|
|
@ -246,7 +246,9 @@ def _fingerprint(public_key, fingerprint_hash_type):
|
|||
was originally hashed with. This defaults to ``sha256`` if not specified.
|
||||
|
||||
.. versionadded:: 2016.11.4
|
||||
.. versionchanged:: 2017.7.0: default changed from ``md5`` to ``sha256``
|
||||
.. versionchanged:: 2017.7.0
|
||||
|
||||
default changed from ``md5`` to ``sha256``
|
||||
|
||||
"""
|
||||
if fingerprint_hash_type:
|
||||
|
@ -879,7 +881,9 @@ def recv_known_host_entries(
|
|||
originally hashed with. This defaults to ``sha256`` if not specified.
|
||||
|
||||
.. versionadded:: 2016.11.4
|
||||
.. versionchanged:: 2017.7.0: default changed from ``md5`` to ``sha256``
|
||||
.. versionchanged:: 2017.7.0
|
||||
|
||||
default changed from ``md5`` to ``sha256``
|
||||
|
||||
CLI Example:
|
||||
|
||||
|
@ -1068,7 +1072,9 @@ def set_known_host(
|
|||
was originally hashed with. This defaults to ``sha256`` if not specified.
|
||||
|
||||
.. versionadded:: 2016.11.4
|
||||
.. versionchanged:: 2017.7.0: default changed from ``md5`` to ``sha256``
|
||||
.. versionchanged:: 2017.7.0
|
||||
|
||||
default changed from ``md5`` to ``sha256``
|
||||
|
||||
CLI Example:
|
||||
|
||||
|
|
|
@ -603,7 +603,6 @@ def get_uid(path, follow_symlinks=True):
|
|||
Returns:
|
||||
str: The uid of the owner
|
||||
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -643,7 +642,6 @@ def get_user(path, follow_symlinks=True):
|
|||
Returns:
|
||||
str: The name of the owner
|
||||
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
|
|
@ -2792,7 +2792,7 @@ class App:
|
|||
This is useful in combination with a browser-based app using the HTML5
|
||||
history API.
|
||||
|
||||
.. http::get:: /app
|
||||
.. http:get:: /app
|
||||
|
||||
:reqheader X-Auth-Token: |req_token|
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ def present(
|
|||
wal_segsize
|
||||
Set the WAL segment size, in megabytes
|
||||
|
||||
.. versionadded:: 2015.XX
|
||||
.. versionadded:: 2016.3.0
|
||||
"""
|
||||
msg = "Cluster {}/{} is already present".format(version, name)
|
||||
ret = {"name": name, "changes": {}, "result": True, "comment": msg}
|
||||
|
@ -129,7 +129,7 @@ def absent(version, name):
|
|||
name
|
||||
The name of the cluster to remove
|
||||
|
||||
.. versionadded:: 2015.XX
|
||||
.. versionadded:: 2016.3.0
|
||||
"""
|
||||
ret = {"name": name, "changes": {}, "result": True, "comment": ""}
|
||||
|
||||
|
|
|
@ -763,7 +763,7 @@ def parallel_runners(name, runners, **kwargs): # pylint: disable=unused-argumen
|
|||
"""
|
||||
Executes multiple runner modules on the master in parallel.
|
||||
|
||||
.. versionadded:: 2017.x.0 (Nitrogen)
|
||||
.. versionadded:: 2018.3.0
|
||||
|
||||
A separate thread is spawned for each runner. This state is intended to be
|
||||
used with the orchestrate runner in place of the ``saltmod.runner`` state
|
||||
|
|
|
@ -6,7 +6,7 @@ This state wraps the saltutil execution modules to make them easier to run
|
|||
from a states. Rather than needing to to use ``module.run`` this state allows for
|
||||
improved change detection.
|
||||
|
||||
.. versionadded: 3000
|
||||
.. versionadded:: 3000
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
|
|
@ -271,6 +271,7 @@ class SaltObject:
|
|||
|
||||
.. code-block:: python
|
||||
:linenos:
|
||||
|
||||
Salt = SaltObject(__salt__)
|
||||
Salt.cmd.run(bar)
|
||||
"""
|
||||
|
|
|
@ -17,7 +17,7 @@ If you need access only to flags, use the Flags object.
|
|||
|
||||
The Dacl object inherits Flags. To use the Dacl object:
|
||||
|
||||
..code-block:: python
|
||||
.. code-block:: python
|
||||
|
||||
import salt.utils.win_dacl
|
||||
dacl = salt.utils.win_dacl.Dacl(obj_type='file')
|
||||
|
|
Loading…
Add table
Reference in a new issue