From 0c7f63e9d42058bed5f0d8a42c5550093591eb7a Mon Sep 17 00:00:00 2001 From: Volodymyr Samodid Date: Tue, 7 Nov 2017 10:24:56 +0200 Subject: [PATCH 1/4] fix docstring errors during rendering --- doc/ref/configuration/master.rst | 5 +++-- doc/ref/configuration/minion.rst | 1 + doc/ref/states/parallel.rst | 2 +- doc/topics/releases/oxygen.rst | 2 ++ doc/topics/spm/master.rst | 1 + doc/topics/spm/spm_formula.rst | 8 ++++---- doc/topics/transports/tcp.rst | 2 +- salt/cloud/clouds/vagrant.py | 1 + salt/cloud/clouds/virtualbox.py | 3 +++ salt/engines/ircbot.py | 4 ++-- salt/modules/boto_apigateway.py | 2 +- salt/modules/boto_ec2.py | 1 + salt/modules/boto_efs.py | 20 ++++++++++---------- salt/modules/grains.py | 1 + salt/modules/jenkins.py | 2 +- salt/modules/kubernetes.py | 1 + salt/modules/nacl.py | 1 + salt/modules/namecheap_dns.py | 3 ++- salt/modules/namecheap_domains.py | 2 +- salt/modules/namecheap_ns.py | 1 + salt/modules/namecheap_ssl.py | 14 +++++++------- salt/modules/napalm_network.py | 3 ++- salt/modules/parallels.py | 2 +- salt/modules/snapper.py | 1 + salt/modules/tomcat.py | 2 +- salt/modules/udev.py | 1 + salt/modules/vault.py | 10 ++++++++-- salt/modules/vsphere.py | 9 +++++++++ salt/modules/zookeeper.py | 1 + salt/netapi/rest_cherrypy/app.py | 4 ++-- salt/pillar/csvpillar.py | 2 +- salt/pillar/nodegroups.py | 1 + salt/runners/jobs.py | 2 ++ salt/runners/nacl.py | 1 + salt/runners/test.py | 2 +- salt/sdb/consul.py | 1 + salt/states/boto_apigateway.py | 2 ++ salt/states/boto_ec2.py | 4 +++- salt/states/boto_iam.py | 4 ++-- salt/states/boto_lambda.py | 1 + salt/states/docker_container.py | 1 + salt/states/elasticsearch_index.py | 1 + salt/states/elasticsearch_index_template.py | 1 + salt/states/etcd_mod.py | 1 + salt/states/libcloud_loadbalancer.py | 1 + salt/states/mac_package.py | 1 + 46 files changed, 93 insertions(+), 43 deletions(-) diff --git a/doc/ref/configuration/master.rst b/doc/ref/configuration/master.rst index 21aac67e05..f186c0e7a8 100644 --- a/doc/ref/configuration/master.rst +++ b/doc/ref/configuration/master.rst @@ -718,7 +718,7 @@ Note that ping_on_rotate may cause high load on the master immediately after the key rotation event as minions reconnect. Consider this carefully if this salt master is managing a large number of minions. -.. code-black:: yaml +.. code-block:: yaml ping_on_rotate: False @@ -904,7 +904,7 @@ is set to ``tcp`` by default on Windows. ipc_mode: ipc -.. conf_master:: +.. conf_master:: tcp_master_pub_port ``tcp_master_pub_port`` ----------------------- @@ -4237,6 +4237,7 @@ Default: ``10`` The number of workers for the runner/wheel in the reactor. .. code-block:: yaml + reactor_worker_threads: 10 .. conf_master:: reactor_worker_hwm diff --git a/doc/ref/configuration/minion.rst b/doc/ref/configuration/minion.rst index 695b956a63..21e376561d 100644 --- a/doc/ref/configuration/minion.rst +++ b/doc/ref/configuration/minion.rst @@ -2387,6 +2387,7 @@ Default: ``10`` The number of workers for the runner/wheel in the reactor. .. code-block:: yaml + reactor_worker_threads: 10 .. conf_minion:: reactor_worker_hwm diff --git a/doc/ref/states/parallel.rst b/doc/ref/states/parallel.rst index 9edf1750e4..c50c7ca3e8 100644 --- a/doc/ref/states/parallel.rst +++ b/doc/ref/states/parallel.rst @@ -51,7 +51,7 @@ actually speed things up. To run the above state much faster make sure that the ``sleep 5`` is evaluated before the ``nginx`` state -.. code_block:: yaml +.. code-block:: yaml sleep 10: cmd.run: diff --git a/doc/topics/releases/oxygen.rst b/doc/topics/releases/oxygen.rst index f3f9d53fe0..965dec0d19 100644 --- a/doc/topics/releases/oxygen.rst +++ b/doc/topics/releases/oxygen.rst @@ -174,11 +174,13 @@ to create it. The generated grain information will appear similar to: .. code-block:: yaml + grains: salt-cloud: driver: ec2 provider: my_ec2:ec2 profile: ec2-web + The generation of salt-cloud grains can be surpressed by the option ``enable_cloud_grains: 'False'`` in the cloud configuration file. diff --git a/doc/topics/spm/master.rst b/doc/topics/spm/master.rst index c412b7322f..8563958700 100644 --- a/doc/topics/spm/master.rst +++ b/doc/topics/spm/master.rst @@ -29,6 +29,7 @@ the name of the repository, and the link to the repository: For HTTP/HTTPS Basic authorization you can define credentials: .. code-block:: yaml + my_repo: url: https://spm.example.com/ username: user diff --git a/doc/topics/spm/spm_formula.rst b/doc/topics/spm/spm_formula.rst index 47ed5e0c60..f8285246f8 100644 --- a/doc/topics/spm/spm_formula.rst +++ b/doc/topics/spm/spm_formula.rst @@ -164,7 +164,7 @@ states are evaluated before ``tgt`` states. Each of these sections needs to be evaluated as text, rather than as YAML. Consider the following block: -.. code-block:: +.. code-block:: text pre_local_state: > echo test > /tmp/spmtest: @@ -187,7 +187,7 @@ a minion. the ``>`` marker to denote that the state is evaluated as text, not a data structure. -.. code-block:: +.. code-block:: text pre_local_state: > echo test > /tmp/spmtest: @@ -203,7 +203,7 @@ the ``spm`` command is running on is a master. Because ``tgt`` states require that a target be specified, their code blocks are a little different. Consider the following state: -.. code-block:: +.. code-block:: text pre_tgt_state: tgt: '*' @@ -229,7 +229,7 @@ This means that you can use Jinja or any other supported renderer inside of Salt. All formula variables are available to the renderer, so you can reference ``FORMULA`` data inside your state if you need to: -.. code-block:: +.. code-block:: text pre_tgt_state: tgt: '*' diff --git a/doc/topics/transports/tcp.rst b/doc/topics/transports/tcp.rst index b4bf3e6f80..60c2635f6b 100644 --- a/doc/topics/transports/tcp.rst +++ b/doc/topics/transports/tcp.rst @@ -34,7 +34,7 @@ passing on a single socket. TLS Support =========== -.. version_added:: 2016.11.1 +.. versionadded:: 2016.11.1 The TCP transport allows for the master/minion communication to be optionally wrapped in a TLS connection. Enabling this is simple, the master and minion need diff --git a/salt/cloud/clouds/vagrant.py b/salt/cloud/clouds/vagrant.py index 830c8b57da..7a17bc249f 100644 --- a/salt/cloud/clouds/vagrant.py +++ b/salt/cloud/clouds/vagrant.py @@ -194,6 +194,7 @@ def create(vm_): CLI Example: .. code-block:: bash + salt-cloud -p my_profile new_node_1 ''' diff --git a/salt/cloud/clouds/virtualbox.py b/salt/cloud/clouds/virtualbox.py index 4266ce5f0e..305521beec 100644 --- a/salt/cloud/clouds/virtualbox.py +++ b/salt/cloud/clouds/virtualbox.py @@ -198,7 +198,9 @@ def list_nodes_full(kwargs=None, call=None): This is because some functions both within Salt and 3rd party will break if an expected field is not present. This function is normally called with the -F option: + .. code-block:: bash + salt-cloud -F @@ -244,6 +246,7 @@ def list_nodes(kwargs=None, call=None): This function is normally called with the -Q option: .. code-block:: bash + salt-cloud -Q diff --git a/salt/engines/ircbot.py b/salt/engines/ircbot.py index 933c7dc83f..c350483684 100644 --- a/salt/engines/ircbot.py +++ b/salt/engines/ircbot.py @@ -40,7 +40,7 @@ event [, ] Example of usage -.. code:: txt +.. code-block:: txt 08:33:57 @gtmanfred > !ping 08:33:57 gtmanbot > gtmanfred: pong @@ -49,7 +49,7 @@ Example of usage 08:34:17 @gtmanfred > !event test/tag/ircbot irc is usefull 08:34:17 gtmanbot > gtmanfred: TaDa! -.. code:: txt +.. code-block:: txt [DEBUG ] Sending event: tag = salt/engines/ircbot/test/tag/ircbot; data = {'_stamp': '2016-11-28T14:34:16.633623', 'data': [u'irc', u'is', u'usefull']} diff --git a/salt/modules/boto_apigateway.py b/salt/modules/boto_apigateway.py index 6b42350b5a..dc14e9e844 100644 --- a/salt/modules/boto_apigateway.py +++ b/salt/modules/boto_apigateway.py @@ -2,7 +2,7 @@ ''' Connection module for Amazon APIGateway -.. versionadded:: +.. versionadded:: 2016.11.0 :configuration: This module accepts explicit Lambda credentials but can also utilize IAM roles assigned to the instance trough Instance Profiles. diff --git a/salt/modules/boto_ec2.py b/salt/modules/boto_ec2.py index 619c219e0d..bbaa6c5684 100644 --- a/salt/modules/boto_ec2.py +++ b/salt/modules/boto_ec2.py @@ -1747,6 +1747,7 @@ def set_volumes_tags(tag_maps, authoritative=False, dry_run=False, YAML example fragment: .. code-block:: yaml + - filters: attachment.instance_id: i-abcdef12 tags: diff --git a/salt/modules/boto_efs.py b/salt/modules/boto_efs.py index 63bceb57ef..3fbf6e5d5e 100644 --- a/salt/modules/boto_efs.py +++ b/salt/modules/boto_efs.py @@ -156,7 +156,7 @@ def create_file_system(name, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' boto_efs.create_file_system efs-name generalPurpose ''' @@ -222,7 +222,7 @@ def create_mount_target(filesystemid, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' boto_efs.create_mount_target filesystemid subnetid ''' @@ -269,7 +269,7 @@ def create_tags(filesystemid, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' boto_efs.create_tags ''' @@ -301,7 +301,7 @@ def delete_file_system(filesystemid, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' boto_efs.delete_file_system filesystemid ''' @@ -335,7 +335,7 @@ def delete_mount_target(mounttargetid, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' boto_efs.delete_mount_target mounttargetid ''' @@ -363,7 +363,7 @@ def delete_tags(filesystemid, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' boto_efs.delete_tags ''' @@ -398,7 +398,7 @@ def get_file_systems(filesystemid=None, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' boto_efs.get_file_systems efs-id ''' @@ -454,7 +454,7 @@ def get_mount_targets(filesystemid=None, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' boto_efs.get_mount_targets ''' @@ -493,7 +493,7 @@ def get_tags(filesystemid, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' boto_efs.get_tags efs-id ''' @@ -527,7 +527,7 @@ def set_security_groups(mounttargetid, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' boto_efs.set_security_groups my-mount-target-id my-sec-group ''' diff --git a/salt/modules/grains.py b/salt/modules/grains.py index a4822477b1..b15cff2900 100644 --- a/salt/modules/grains.py +++ b/salt/modules/grains.py @@ -413,6 +413,7 @@ def delkey(key): CLI Example: .. code-block:: bash + salt '*' grains.delkey key ''' setval(key, None, destructive=True) diff --git a/salt/modules/jenkins.py b/salt/modules/jenkins.py index 1041e46d31..98f010455d 100644 --- a/salt/modules/jenkins.py +++ b/salt/modules/jenkins.py @@ -112,7 +112,7 @@ def run(script): CLI Example: - .. code-block:: + .. code-block:: bash salt '*' jenkins.run 'Jenkins.instance.doSafeRestart()' diff --git a/salt/modules/kubernetes.py b/salt/modules/kubernetes.py index bdbbf5c0c3..5654bd567a 100644 --- a/salt/modules/kubernetes.py +++ b/salt/modules/kubernetes.py @@ -28,6 +28,7 @@ For an item only one field should be provided. Either a `data` or a `file` entry In case both are provided the `file` entry is prefered. .. code-block:: bash + salt '*' kubernetes.nodes api_url=http://k8s-api-server:port api_user=myuser api_password=pass .. versionadded: 2017.7.0 diff --git a/salt/modules/nacl.py b/salt/modules/nacl.py index 228d72974d..5910f4833b 100644 --- a/salt/modules/nacl.py +++ b/salt/modules/nacl.py @@ -85,6 +85,7 @@ without extra parameters: salt-run nacl.dec 'tqXzeIJnTAM9Xf0mdLcpEdklMbfBGPj2oTKmlgrm3S1DTVVHNnh9h8mU1GKllGq/+cYsk6m5WhGdk58=' .. code-block:: yam + # a salt developers minion could have pillar data that includes a nacl public key nacl.config: pk: '/kfGX7PbWeu099702PBbKWLpG/9p06IQRswkdWHCDk0=' diff --git a/salt/modules/namecheap_dns.py b/salt/modules/namecheap_dns.py index 472980352b..5a8e115a68 100644 --- a/salt/modules/namecheap_dns.py +++ b/salt/modules/namecheap_dns.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' - Namecheap management +Namecheap management .. versionadded:: 2017.7.0 @@ -17,6 +17,7 @@ the namecheap API: * ``requests`` + .. code-block:: bash pip install requests diff --git a/salt/modules/namecheap_domains.py b/salt/modules/namecheap_domains.py index 55707179ec..a699b795d2 100644 --- a/salt/modules/namecheap_domains.py +++ b/salt/modules/namecheap_domains.py @@ -73,7 +73,7 @@ def reactivate(domain_name): CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' namecheap_domains.reactivate my-domain-name diff --git a/salt/modules/namecheap_ns.py b/salt/modules/namecheap_ns.py index 22214090b1..d4a98c650d 100644 --- a/salt/modules/namecheap_ns.py +++ b/salt/modules/namecheap_ns.py @@ -17,6 +17,7 @@ the namecheap API: * ``requests`` + .. code-block:: bash pip install requests diff --git a/salt/modules/namecheap_ssl.py b/salt/modules/namecheap_ssl.py index a0171cedf4..1a0d603653 100644 --- a/salt/modules/namecheap_ssl.py +++ b/salt/modules/namecheap_ssl.py @@ -110,7 +110,7 @@ def reissue(csr_file, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' namecheap_ssl.reissue my-csr-file my-cert-id apachessl ''' @@ -164,7 +164,7 @@ def activate(csr_file, CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' namecheap_ssl.activate my-csr-file my-cert-id apachessl ''' @@ -298,7 +298,7 @@ def renew(years, certificate_id, certificate_type, promotion_code=None): CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' namecheap_ssl.renew 1 my-cert-id RapidSSL ''' @@ -460,7 +460,7 @@ Symantec Secure Site 1 25 24 CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' namecheap_ssl.create 2 RapidSSL ''' @@ -557,7 +557,7 @@ def parse_csr(csr_file, certificate_type, http_dc_validation=False): CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' namecheap_ssl.parse_csr my-csr-file PremiumSSL ''' @@ -644,7 +644,7 @@ def get_list(**kwargs): CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' namecheap_ssl.get_list Processing ''' @@ -688,7 +688,7 @@ def get_info(certificate_id, returncertificate=False, returntype=None): CLI Example: - .. code-block:: + .. code-block:: bash salt 'my-minion' namecheap_ssl.get_info my-cert-id ''' diff --git a/salt/modules/napalm_network.py b/salt/modules/napalm_network.py index 0428177951..542215228d 100644 --- a/salt/modules/napalm_network.py +++ b/salt/modules/napalm_network.py @@ -500,7 +500,7 @@ def cli(*commands, **kwargs): # pylint: disable=unused-argument CLI Example with TextFSM template: - .. code-block:: + .. code-block:: bash salt '*' net.cli textfsm_parse=True textfsm_path=salt://textfsm/ @@ -1238,6 +1238,7 @@ def load_config(filename=None, Example output: .. code-block:: python + { 'comment': 'Configuration discarded.', 'already_configured': False, diff --git a/salt/modules/parallels.py b/salt/modules/parallels.py index d361350cc4..c996f831e2 100644 --- a/salt/modules/parallels.py +++ b/salt/modules/parallels.py @@ -10,7 +10,7 @@ What has not been implemented yet can be accessed through ``parallels.prlctl`` and ``parallels.prlsrvctl`` (note the preceding double dash ``--`` as necessary): -.. code-block:: +.. code-block:: bash salt '*' parallels.prlctl installtools macvm runas=macdev salt -- '*' parallels.prlctl capture 'macvm --file macvm.display.png' runas=macdev diff --git a/salt/modules/snapper.py b/salt/modules/snapper.py index 23384bfa9f..3f3b476bfc 100644 --- a/salt/modules/snapper.py +++ b/salt/modules/snapper.py @@ -229,6 +229,7 @@ def set_config(name='root', **kwargs): snapper convention. The above example is equivalent to: .. code-block:: bash + salt '*' snapper.set_config sync_acl=True ''' try: diff --git a/salt/modules/tomcat.py b/salt/modules/tomcat.py index f5a950ab7b..a7f2a1f54f 100644 --- a/salt/modules/tomcat.py +++ b/salt/modules/tomcat.py @@ -186,7 +186,7 @@ def extract_war_version(war): Examples: - .. code-block:: + .. code-block:: text /path/salt-2015.8.6.war -> 2015.8.6 /path/V6R2013xD5.war -> None diff --git a/salt/modules/udev.py b/salt/modules/udev.py index 758c2bb32a..cd24af6309 100644 --- a/salt/modules/udev.py +++ b/salt/modules/udev.py @@ -170,6 +170,7 @@ def exportdb(): CLI Example: .. code-block:: bash + salt '*' udev.exportdb ''' diff --git a/salt/modules/vault.py b/salt/modules/vault.py index 6717e77f22..16b9c5e792 100644 --- a/salt/modules/vault.py +++ b/salt/modules/vault.py @@ -1,13 +1,16 @@ # -*- coding: utf-8 -*- ''' +Functions to interact with Hashicorp Vault. + :maintainer: SaltStack :maturity: new :platform: all -Functions to interact with Hashicorp Vault. :note: If you see the following error, you'll need to upgrade ``requests`` to atleast 2.4.2 -.. code-block:: shell + +.. code-block:: text + [salt.pillar][CRITICAL][14337] Pillar render error: Failed to load ext_pillar vault: {'error': "request() got an unexpected keyword argument 'json'"} @@ -151,6 +154,7 @@ def write_secret(path, **kwargs): CLI Example: .. code-block:: bash + salt '*' vault.write_secret "secret/my/secret" user="foo" password="bar" ''' log.debug( @@ -176,6 +180,7 @@ def delete_secret(path): CLI Example: .. code-block:: bash + salt '*' vault.delete_secret "secret/my/secret" ''' log.debug('Deleting vault secrets for {0} in {1}' @@ -199,6 +204,7 @@ def list_secrets(path): CLI Example: .. code-block:: bash + salt '*' vault.list_secrets "secret/my/" ''' log.debug('Listing vault secret keys for {0} in {1}' diff --git a/salt/modules/vsphere.py b/salt/modules/vsphere.py index a18ab459f3..b393d5fd37 100644 --- a/salt/modules/vsphere.py +++ b/salt/modules/vsphere.py @@ -4211,6 +4211,7 @@ def list_dvportgroups(dvs=None, portgroup_names=None, service_instance=None): Default is None. .. code-block:: bash + salt '*' vsphere.list_dvporgroups salt '*' vsphere.list_dvportgroups dvs=dvs1 @@ -4662,6 +4663,7 @@ def list_storage_policies(policy_names=None, service_instance=None): Default is None. .. code-block:: bash + salt '*' vsphere.list_storage_policies salt '*' vsphere.list_storage_policy policy_names=[policy_name] @@ -4688,6 +4690,7 @@ def list_default_vsan_policy(service_instance=None): Default is None. .. code-block:: bash + salt '*' vsphere.list_storage_policies salt '*' vsphere.list_storage_policy policy_names=[policy_name] @@ -4726,6 +4729,7 @@ def list_capability_definitions(service_instance=None): Default is None. .. code-block:: bash + salt '*' vsphere.list_capabilities ''' profile_manager = salt.utils.pbm.get_profile_manager(service_instance) @@ -4806,6 +4810,7 @@ def create_storage_policy(policy_name, policy_dict, service_instance=None): Default is None. .. code-block:: bash + salt '*' vsphere.create_storage_policy policy_name='policy name' policy_dict="$policy_dict" ''' @@ -4845,6 +4850,7 @@ def update_storage_policy(policy, policy_dict, service_instance=None): Default is None. .. code-block:: bash + salt '*' vsphere.update_storage_policy policy='policy name' policy_dict="$policy_dict" ''' @@ -4882,6 +4888,7 @@ def list_default_storage_policy_of_datastore(datastore, service_instance=None): Default is None. .. code-block:: bash + salt '*' vsphere.list_default_storage_policy_of_datastore datastore=ds1 ''' log.trace('Listing the default storage policy of datastore \'{0}\'' @@ -4920,6 +4927,7 @@ def assign_default_storage_policy_to_datastore(policy, datastore, Default is None. .. code-block:: bash + salt '*' vsphere.assign_storage_policy_to_datastore policy='policy name' datastore=ds1 ''' @@ -4964,6 +4972,7 @@ def list_datacenters_via_proxy(datacenter_names=None, service_instance=None): Default is None. .. code-block:: bash + salt '*' vsphere.list_datacenters_via_proxy salt '*' vsphere.list_datacenters_via_proxy dc1 diff --git a/salt/modules/zookeeper.py b/salt/modules/zookeeper.py index 1483de3388..e8eac9f5a3 100644 --- a/salt/modules/zookeeper.py +++ b/salt/modules/zookeeper.py @@ -34,6 +34,7 @@ Configuration be set up as different configuration profiles. For example: .. code-block:: yaml + zookeeper: prod: hosts: zoo1,zoo2,zoo3 diff --git a/salt/netapi/rest_cherrypy/app.py b/salt/netapi/rest_cherrypy/app.py index 3c2f7ac670..7c5749ffa5 100644 --- a/salt/netapi/rest_cherrypy/app.py +++ b/salt/netapi/rest_cherrypy/app.py @@ -71,12 +71,12 @@ A REST API for Salt log_access_file Path to a file to write HTTP access logs. - .. versionaddedd:: 2016.11.0 + .. versionadded:: 2016.11.0 log_error_file Path to a file to write HTTP error logs. - .. versionaddedd:: 2016.11.0 + .. versionadded:: 2016.11.0 ssl_crt The path to a SSL certificate. (See below) diff --git a/salt/pillar/csvpillar.py b/salt/pillar/csvpillar.py index 352fca9546..3585cde621 100644 --- a/salt/pillar/csvpillar.py +++ b/salt/pillar/csvpillar.py @@ -2,7 +2,7 @@ ''' Store key/value pairs in a CSV file -.. versionaddedd:: 2016.11.0 +.. versionadded:: 2016.11.0 Example configuration: diff --git a/salt/pillar/nodegroups.py b/salt/pillar/nodegroups.py index 540213436c..43e3404a2c 100644 --- a/salt/pillar/nodegroups.py +++ b/salt/pillar/nodegroups.py @@ -16,6 +16,7 @@ Command Line ------------ .. code-block:: bash + salt-call pillar.get nodegroups local: - class_infra diff --git a/salt/runners/jobs.py b/salt/runners/jobs.py index 0ce3565bf3..13a807bc3a 100644 --- a/salt/runners/jobs.py +++ b/salt/runners/jobs.py @@ -466,7 +466,9 @@ def exit_success(jid, ext_source=None): The external job cache to use. Default: `None`. CLI Example: + .. code-block:: bash + salt-run jobs.exit_success 20160520145827701627 ''' ret = dict() diff --git a/salt/runners/nacl.py b/salt/runners/nacl.py index 2ccd888bef..15b957c7a3 100644 --- a/salt/runners/nacl.py +++ b/salt/runners/nacl.py @@ -85,6 +85,7 @@ without extra parameters: salt-run nacl.dec 'tqXzeIJnTAM9Xf0mdLcpEdklMbfBGPj2oTKmlgrm3S1DTVVHNnh9h8mU1GKllGq/+cYsk6m5WhGdk58=' .. code-block:: yam + # a salt developers minion could have pillar data that includes a nacl public key nacl.config: pk: '/kfGX7PbWeu099702PBbKWLpG/9p06IQRswkdWHCDk0=' diff --git a/salt/runners/test.py b/salt/runners/test.py index 0d56edf17f..d5c9c7c465 100644 --- a/salt/runners/test.py +++ b/salt/runners/test.py @@ -85,7 +85,7 @@ def get_opts(): CLI Example: - .. code-block:: + .. code-block:: bash salt-run test.get_opts ''' diff --git a/salt/sdb/consul.py b/salt/sdb/consul.py index 16cce0e608..531b8f8e88 100644 --- a/salt/sdb/consul.py +++ b/salt/sdb/consul.py @@ -13,6 +13,7 @@ be configured in either the minion or master configuration file. This profile requires very little. For example: .. code-block:: yaml + myconsul: driver: consul host: 127.0.0.1 diff --git a/salt/states/boto_apigateway.py b/salt/states/boto_apigateway.py index 7288230144..4146fb772e 100644 --- a/salt/states/boto_apigateway.py +++ b/salt/states/boto_apigateway.py @@ -124,7 +124,9 @@ def present(name, api_name, swagger_file, stage_name, api_key_required, with the following schema. The lambda functions should throw exceptions for any non successful responses. An optional pattern field can be specified in errorMessage field to aid the response mapping from Lambda to the proper error return status codes. + .. code-block:: yaml + Error: type: object properties: diff --git a/salt/states/boto_ec2.py b/salt/states/boto_ec2.py index 589f3d6a90..12f9b1de37 100644 --- a/salt/states/boto_ec2.py +++ b/salt/states/boto_ec2.py @@ -984,7 +984,7 @@ def instance_absent(name, instance_name=None, instance_id=None, ''' Ensure an EC2 instance does not exist (is stopped and removed). - .. versionupdated:: 2016.11.0 + .. versionchanged:: 2016.11.0 name (string) - The name of the state definition. @@ -1010,6 +1010,7 @@ def instance_absent(name, instance_name=None, instance_id=None, YAML example fragment: .. code-block:: yaml + - filters: vpc-id: vpc-abcdef12 @@ -1230,6 +1231,7 @@ def volumes_tagged(name, tag_maps, authoritative=False, region=None, key=None, YAML example fragment: .. code-block:: yaml + - filters: attachment.instance_id: i-abcdef12 tags: diff --git a/salt/states/boto_iam.py b/salt/states/boto_iam.py index 9889d4a569..23f01a2205 100644 --- a/salt/states/boto_iam.py +++ b/salt/states/boto_iam.py @@ -1636,7 +1636,7 @@ def policy_absent(name, def saml_provider_present(name, saml_metadata_document, region=None, key=None, keyid=None, profile=None): ''' - .. versionadded:: + .. versionadded:: 2016.11.0 Ensure the SAML provider with the specified name is present. @@ -1694,7 +1694,7 @@ def saml_provider_present(name, saml_metadata_document, region=None, key=None, k def saml_provider_absent(name, region=None, key=None, keyid=None, profile=None): ''' - .. versionadded:: + .. versionadded:: 2016.11.0 Ensure the SAML provider with the specified name is absent. diff --git a/salt/states/boto_lambda.py b/salt/states/boto_lambda.py index 48729a17e3..5fd54d1c0f 100644 --- a/salt/states/boto_lambda.py +++ b/salt/states/boto_lambda.py @@ -153,6 +153,7 @@ def function_present(name, FunctionName, Runtime, Role, Handler, ZipFile=None, to the same VPC. This is a dict of the form: .. code-block:: yaml + VpcConfig: SecurityGroupNames: - mysecgroup1 diff --git a/salt/states/docker_container.py b/salt/states/docker_container.py index cbcdb2aeb6..b5721c3f4a 100644 --- a/salt/states/docker_container.py +++ b/salt/states/docker_container.py @@ -1235,6 +1235,7 @@ def running(name, If ``True``, runs the exec process with extended privileges .. code-block:: yaml + foo: docker_container.running: - image: bar/baz:lates diff --git a/salt/states/elasticsearch_index.py b/salt/states/elasticsearch_index.py index bd4c3d1732..f2d6bc462e 100644 --- a/salt/states/elasticsearch_index.py +++ b/salt/states/elasticsearch_index.py @@ -65,6 +65,7 @@ def present(name, definition=None): **Example:** .. code-block:: yaml + # Default settings mytestindex: elasticsearch_index.present diff --git a/salt/states/elasticsearch_index_template.py b/salt/states/elasticsearch_index_template.py index 8bb0d7f2ee..679b88a69b 100644 --- a/salt/states/elasticsearch_index_template.py +++ b/salt/states/elasticsearch_index_template.py @@ -65,6 +65,7 @@ def present(name, definition): **Example:** .. code-block:: yaml + mytestindex2_template: elasticsearch_index_template.present: - definition: diff --git a/salt/states/etcd_mod.py b/salt/states/etcd_mod.py index 48f5c6f993..1eef05c697 100644 --- a/salt/states/etcd_mod.py +++ b/salt/states/etcd_mod.py @@ -45,6 +45,7 @@ Etcd profile configuration can be overriden using following arguments: ``host``, ``port``, ``username``, ``password``, ``ca``, ``client_key`` and ``client_cert``. .. code-block:: yaml + my-value: etcd.set: - name: /path/to/key diff --git a/salt/states/libcloud_loadbalancer.py b/salt/states/libcloud_loadbalancer.py index 5b9c41dc70..d7d7cc3be2 100644 --- a/salt/states/libcloud_loadbalancer.py +++ b/salt/states/libcloud_loadbalancer.py @@ -34,6 +34,7 @@ Example: Using States to deploy a load balancer with extended arguments to specify region .. code-block:: yaml + lb_test: libcloud_loadbalancer.balancer_present: - name: example diff --git a/salt/states/mac_package.py b/salt/states/mac_package.py index 4d100e65c6..4ca3e68aa1 100644 --- a/salt/states/mac_package.py +++ b/salt/states/mac_package.py @@ -91,6 +91,7 @@ def installed(name, target="LocalSystem", dmg=False, store=False, app=False, mpk The command and version that we want to check against, the version number can use regex. .. code-block:: yaml + version_check: python --version_check=2.7.[0-9] ''' From 4e3c5075e16d88ea2e4bc5d9063c241bac344c73 Mon Sep 17 00:00:00 2001 From: Volodymyr Samodid Date: Tue, 7 Nov 2017 10:24:56 +0200 Subject: [PATCH 2/4] Update modules docstring for better auto index description --- salt/modules/defaults.py | 5 +++++ salt/modules/mac_shadow.py | 4 ++-- salt/modules/mac_system.py | 5 ++--- salt/modules/namecheap_dns.py | 2 +- salt/modules/namecheap_domains.py | 2 +- salt/modules/namecheap_ns.py | 2 +- salt/modules/namecheap_ssl.py | 2 +- salt/modules/namecheap_users.py | 2 +- salt/modules/openscap.py | 5 +++++ salt/modules/reg.py | 2 -- salt/modules/win_dsc.py | 4 ++-- salt/modules/zk_concurrency.py | 6 +++--- 12 files changed, 24 insertions(+), 17 deletions(-) diff --git a/salt/modules/defaults.py b/salt/modules/defaults.py index 75e827c1ad..ac92e4fe8b 100644 --- a/salt/modules/defaults.py +++ b/salt/modules/defaults.py @@ -1,4 +1,9 @@ # -*- coding: utf-8 -*- +''' +Module to work with salt formula defaults files + +''' + from __future__ import absolute_import import json import logging diff --git a/salt/modules/mac_shadow.py b/salt/modules/mac_shadow.py index 6daaa14360..9ed1bcd208 100644 --- a/salt/modules/mac_shadow.py +++ b/salt/modules/mac_shadow.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- ''' -.. versionadded:: 2016.3.0 +Manage macOS local directory passwords and policies -Manage macOS local directory passwords and policies. +.. versionadded:: 2016.3.0 Note that it is usually better to apply password policies through the creation of a configuration profile. diff --git a/salt/modules/mac_system.py b/salt/modules/mac_system.py index 9d92502573..ef5b2825a9 100644 --- a/salt/modules/mac_system.py +++ b/salt/modules/mac_system.py @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- ''' -.. versionadded:: 2016.3.0 +System module for sleeping, restarting, and shutting down the system on Mac OS X -System module for sleeping, restarting, and shutting down the system on Mac OS -X. +.. versionadded:: 2016.3.0 .. warning:: Using this module will enable ``atrun`` on the system if it is disabled. diff --git a/salt/modules/namecheap_dns.py b/salt/modules/namecheap_dns.py index 5a8e115a68..a657ccf65b 100644 --- a/salt/modules/namecheap_dns.py +++ b/salt/modules/namecheap_dns.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -Namecheap management +Namecheap dns management .. versionadded:: 2017.7.0 diff --git a/salt/modules/namecheap_domains.py b/salt/modules/namecheap_domains.py index a699b795d2..a86b5537b0 100644 --- a/salt/modules/namecheap_domains.py +++ b/salt/modules/namecheap_domains.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' - Namecheap management +Namecheap domains management .. versionadded:: 2017.7.0 diff --git a/salt/modules/namecheap_ns.py b/salt/modules/namecheap_ns.py index d4a98c650d..db0ccd74cc 100644 --- a/salt/modules/namecheap_ns.py +++ b/salt/modules/namecheap_ns.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' - Namecheap management +Namecheap nameservers management .. versionadded:: 2017.7.0 diff --git a/salt/modules/namecheap_ssl.py b/salt/modules/namecheap_ssl.py index 1a0d603653..d78271e95d 100644 --- a/salt/modules/namecheap_ssl.py +++ b/salt/modules/namecheap_ssl.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' - Namecheap management +Namecheap ssl management .. versionadded:: 2017.7.0 diff --git a/salt/modules/namecheap_users.py b/salt/modules/namecheap_users.py index 877712336d..112bcca640 100644 --- a/salt/modules/namecheap_users.py +++ b/salt/modules/namecheap_users.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' - Namecheap management +Namecheap users management .. versionadded:: 2017.7.0 diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index 2061550012..f9adc02940 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -1,4 +1,9 @@ # -*- coding: utf-8 -*- +''' +Module for OpenSCAP Management + +''' + from __future__ import absolute_import import tempfile import shlex diff --git a/salt/modules/reg.py b/salt/modules/reg.py index 04f1cdbba5..eefac5c815 100644 --- a/salt/modules/reg.py +++ b/salt/modules/reg.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- ''' -=========================== Manage the Windows registry -=========================== ----- Hives diff --git a/salt/modules/win_dsc.py b/salt/modules/win_dsc.py index 56a2b28052..64fec5d1b7 100644 --- a/salt/modules/win_dsc.py +++ b/salt/modules/win_dsc.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- ''' -This module is Alpha - Module for working with Windows PowerShell DSC (Desired State Configuration) +This module is Alpha + This module applies DSC Configurations in the form of PowerShell scripts or MOF (Managed Object Format) schema files. diff --git a/salt/modules/zk_concurrency.py b/salt/modules/zk_concurrency.py index 2dc0a8dbf5..f7607d23cf 100644 --- a/salt/modules/zk_concurrency.py +++ b/salt/modules/zk_concurrency.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- ''' -:depends: kazoo -:configuration: See :py:mod:`salt.modules.zookeeper` for setup instructions. - Concurrency controls in zookeeper ========================================================================= +:depends: kazoo +:configuration: See :py:mod:`salt.modules.zookeeper` for setup instructions. + This module allows you to acquire and release a slot. This is primarily useful for ensureing that no more than N hosts take a specific action at once. This can also be used to coordinate between masters. From 4cac95de3e7c8699146a072bd8803e6462b6e65b Mon Sep 17 00:00:00 2001 From: Volodymyr Samodid Date: Tue, 7 Nov 2017 10:24:56 +0200 Subject: [PATCH 3/4] Update states docstring for better auto index description --- salt/states/csf.py | 5 ++--- salt/states/msteams.py | 1 + salt/states/reg.py | 2 +- salt/states/sysrc.py | 4 ++++ salt/states/telemetry_alert.py | 4 ++-- salt/states/vagrant.py | 4 ++-- salt/states/vault.py | 5 +++-- salt/states/zk_concurrency.py | 5 +++-- 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/salt/states/csf.py b/salt/states/csf.py index 24c79c971e..3416df3702 100644 --- a/salt/states/csf.py +++ b/salt/states/csf.py @@ -1,7 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import -from salt.ext.six.moves import map - ''' CSF Ip tables management ======================== @@ -18,6 +15,8 @@ CSF Ip tables management method: allow ''' # pylint: disable=W0105 +from __future__ import absolute_import +from salt.ext.six.moves import map def __virtual__(): return 'csf' diff --git a/salt/states/msteams.py b/salt/states/msteams.py index 59715bb6cb..8eb6245ee2 100644 --- a/salt/states/msteams.py +++ b/salt/states/msteams.py @@ -2,6 +2,7 @@ ''' Send a message card to Microsoft Teams ======================= + This state is useful for sending messages to Teams during state runs. .. versionadded:: 2017.7.0 .. code-block:: yaml diff --git a/salt/states/reg.py b/salt/states/reg.py index b752c8bac2..c8bc430da6 100644 --- a/salt/states/reg.py +++ b/salt/states/reg.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- r''' -=========================== Manage the Windows registry =========================== + Many python developers think of registry keys as if they were python keys in a dictionary which is not the case. The windows registry is broken down into the following components: diff --git a/salt/states/sysrc.py b/salt/states/sysrc.py index 223bf56db3..faaab7824a 100644 --- a/salt/states/sysrc.py +++ b/salt/states/sysrc.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +''' +State to work with sysrc + +''' # Import Python libs from __future__ import absolute_import diff --git a/salt/states/telemetry_alert.py b/salt/states/telemetry_alert.py index 272816621d..ee70ef25ce 100644 --- a/salt/states/telemetry_alert.py +++ b/salt/states/telemetry_alert.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- ''' -.. versionadded:: 2016.3.0. - Manage Telemetry alert configurations ===================================== +.. versionadded:: 2016.3.0 + Create, Update and destroy Mongo Telemetry alert configurations. This module uses requests, which can be installed via package, or pip. diff --git a/salt/states/vagrant.py b/salt/states/vagrant.py index edeec1f0db..2e7369c705 100644 --- a/salt/states/vagrant.py +++ b/salt/states/vagrant.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- r''' -.. index:: Vagrant state function - Manage Vagrant VMs ================== +.. index:: Vagrant state function + Manange execution of Vagrant virtual machines on Salt minions. Vagrant_ is a tool for building and managing virtual machine environments. diff --git a/salt/states/vault.py b/salt/states/vault.py index d86bc4cb0a..3f6a775bfb 100644 --- a/salt/states/vault.py +++ b/salt/states/vault.py @@ -1,13 +1,14 @@ # -*- coding: utf-8 -*- ''' +States for managing Hashicorp Vault. +Currently handles policies. Configuration instructions are documented in the execution module docs. + :maintainer: SaltStack :maturity: new :platform: all .. versionadded:: 2017.7.0 -States for managing Hashicorp Vault. Currently handles policies. Configuration -instructions are documented in the execution module docs. ''' from __future__ import absolute_import import logging diff --git a/salt/states/zk_concurrency.py b/salt/states/zk_concurrency.py index 14a9075572..6d87d00061 100644 --- a/salt/states/zk_concurrency.py +++ b/salt/states/zk_concurrency.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- ''' +Control concurrency of steps within state execution using zookeeper +=================================================================== + :depends: kazoo :configuration: See :py:mod:`salt.modules.zookeeper` for setup instructions. -Control concurrency of steps within state execution using zookeeper -=================================================================== This module allows you to "wrap" a state's execution with concurrency control. This is useful to protect against all hosts executing highstate simultaneously From 61abaa6ad5418d077f0e2c58394952c4f260d9ed Mon Sep 17 00:00:00 2001 From: Volodymyr Samodid Date: Tue, 7 Nov 2017 19:14:17 +0200 Subject: [PATCH 4/4] fix small lint error --- salt/states/csf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/salt/states/csf.py b/salt/states/csf.py index 3416df3702..f0c1aea1f7 100644 --- a/salt/states/csf.py +++ b/salt/states/csf.py @@ -18,6 +18,7 @@ CSF Ip tables management from __future__ import absolute_import from salt.ext.six.moves import map + def __virtual__(): return 'csf'