Commit graph

436 commits

Author SHA1 Message Date
Dmitry Kuzmenko
7f26e764fc
Revert "Update doc conf with the new import tornado.queues"
This reverts commit 684bf584f6.
2019-04-17 02:00:22 +03:00
Ch3LL
63962b547a
Merge branch '2018.3' into '2019.2'
Conflicts:
  - salt/states/linux_acl.py
  - salt/transport/ipc.py
2019-03-28 11:10:45 -04:00
Dmitry Kuzmenko
684bf584f6
Update doc conf with the new import tornado.queues 2019-03-20 21:04:49 +03:00
Ch3LL
f28cc9bff1
[2019.2] change build_type and release in doc/conf.py 2019-02-22 15:26:16 -05:00
Ch3LL
904beb3548
[2018.3] change build_type and release in doc/conf.py 2019-02-22 15:18:33 -05:00
Ch3LL
4c670e2e62
Update release versions for the 2019.2 branch 2019-02-22 15:02:48 -05:00
Ch3LL
3efcea50f1
Update release versions for the 2018.3 branch 2019-02-22 15:01:24 -05:00
Gareth J. Greenaway
490a39dda5
Adding missing line back into doc/conf.py 2018-12-21 08:29:30 -08:00
Gareth J. Greenaway
9c04986641
Merge branch '2018.3' into merge-fluorine
Conflicts:
	doc/conf.py
	doc/topics/development/dunder_dictionaries.rst
	salt/client/ssh/ssh_py_shim.py
	salt/grains/core.py
	salt/modules/mysql.py
	salt/modules/state.py
2018-12-20 17:20:42 -08:00
Benjamin Drung
ecdb452e8a doc: Indroduce MOCK_MODULES_MAPPING
Some mocks needs some attributes defined (instead of having them returning a
mock object). Introduce a MOCK_MODULES_MAPPING mapping that defines these
attributes. This gets rid of a special handling for psutil.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:55:37 +01:00
Benjamin Drung
cf648246ea doc: Move mock_decorator_with_params up
Refactor conf.py and move mock_decorator_with_params for the following commit.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:55:37 +01:00
Benjamin Drung
08ef6694ea doc: Address pylint issues in conf.py
pylint finds issues in doc/conf.py:

```
pylint3 conf.py
************* Module conf
conf.py:226:0: C0330: Wrong hanging indentation (remove 4 spaces).
        os.pardir,  # salt itself (for autodoc)
    |   ^ (bad-continuation)
conf.py:227:0: C0330: Wrong hanging indentation (remove 4 spaces).
        '_ext',  # custom Sphinx extensions
    |   ^ (bad-continuation)
conf.py:374:0: C0301: Line too long (106/100) (line-too-long)
conf.py:442:0: C0330: Wrong hanging indentation (add 2 spaces).
  ('contents', 'Salt.tex', 'Salt Documentation', 'SaltStack, Inc.', 'manual'),
  ^ | (bad-continuation)
conf.py:485:0: C0301: Line too long (107/100) (line-too-long)
conf.py:27:0: W0613: Unused argument 'args' (unused-argument)
conf.py:27:0: W0613: Unused argument 'kwargs' (unused-argument)
conf.py:58:4: R0201: Method could be a function (no-self-use)
conf.py:198:8: R1705: Unnecessary "else" after "return" (no-else-return)
conf.py:197:0: W0613: Unused argument 'iargs' (unused-argument)
conf.py:197:0: W0613: Unused argument 'ikwargs' (unused-argument)
conf.py:187:0: W0613: Unused argument 'oargs' (unused-argument)
conf.py:187:0: W0613: Unused argument 'okwargs' (unused-argument)
conf.py:533:0: R0913: Too many arguments (6/5) (too-many-arguments)
conf.py:533:25: W0613: Unused argument 'app' (unused-argument)
conf.py:533:30: W0613: Unused argument 'what' (unused-argument)
conf.py:533:47: W0613: Unused argument 'skip' (unused-argument)
conf.py:533:53: W0613: Unused argument 'options' (unused-argument)
conf.py:542:7: W0621: Redefining name 'path' from outer scope (line 230) (redefined-outer-name)
conf.py:6:0: W0611: Unused import functools (unused-import)
conf.py:310:4: W0611: Unused import sphinxcontrib.spelling (unused-import)
```

Address those or silince pylint for wanted behavior.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:55:35 +01:00
Benjamin Drung
67a3e371a6 doc: Mark preamble variable as raw string
Importing `doc/conf.py` fails with Python 3.7:

```
>>> from conf import Mock
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "doc/conf.py", line 454
    ''',
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 5-6: truncated \uXXXX escape
```

Therefore mark the string as raw due to the backslashes.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:55:03 +01:00
Benjamin Drung
b973e7aae1 doc: Fix iterating over the Mock object in Python 3
Building the documentation for salt.modules.snapper fails with Python 3:

```
$ make -C doc html
[...]
WARNING: [autosummary] failed to import 'salt.modules.snapper': no module named salt.modules.snapper
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 109 source files that are out of date
updating environment: [config changed] 1608 added, 17 changed, 0 removed
reading sources... [100%] topics/yaml/index
doc/ref/modules/all/index.rst:20: WARNING: failed to import snapper
doc/ref/modules/all/index.rst:20: WARNING: toctree references unknown document 'ref/modules/all/snapper'
WARNING: autodoc: failed to import module 'salt.modules.snapper'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc/importer.py", line 152, in import_module
    __import__(modname)
  File "salt/modules/snapper.py", line 72, in <module>
    if SNAPPER_DBUS_OBJECT in bus.list_activatable_names():
TypeError: argument of type 'Mock' is not iterable
```

Fix the Mock object to be iterable (as it was intended to).

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:54:39 +01:00
Benjamin Drung
bb2994898c doc: Do not mock non-existing __mro_entries__ attribute
Building the documentation with the Python 3.7 version of sphinx fails:

```
$ make -C doc html SPHINXBUILD="python3.7 /usr/bin/sphinx-build"
[...]
WARNING: autodoc: failed to import module 'salt.states.pkg'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc/importer.py", line 152, in import_module
    __import__(modname)
  File "salt/states/pkg.py", line 84, in <module>
    import salt.utils.pkg
  File "salt/utils/pkg/__init__.py", line 13, in <module>
    import salt.utils.data
  File "salt/utils/data.py", line 23, in <module>
    import salt.utils.yaml
  File "salt/utils/yaml.py", line 9, in <module>
    from salt.utils.yamldumper import *
  File "salt/utils/yamldumper.py", line 34, in <module>
    class IndentMixin(Dumper):
TypeError: __mro_entries__ must return a tuple
```

Instead of returning a Mock object for the `__mro_entries__` attribute, raise
an AttributeError instead.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:28:04 +01:00
Benjamin Drung
e6cf3c4a94 Do not mock json when building the documentation
Building the documentation on Debian unstable with Python 3.7 fails:

```
debian-unstable$ HTML_THEME=saltstack make -C doc html
make: Entering directory 'doc'
No need to update translations. Skipping...
sphinx-build -b html -d _build/doctrees    . _build/html
Running Sphinx v1.7.9
loading translations [en]... done

Exception occurred:
  File "/usr/lib/python3/dist-packages/sphinx/util/jsonimpl.py", line 22, in <module>
    class SphinxJSONEncoder(json.JSONEncoder):
TypeError: __mro_entries__ must return a tuple
The full traceback has been saved in /tmp/sphinx-err-wzl9_n0k.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [Makefile:72: html] Error 2
make: Leaving directory 'doc'
debian-unstable$ cat /tmp/sphinx-err-wzl9_n0k.log

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/cmdline.py", line 303, in main
    args.warningiserror, args.tags, args.verbosity, args.jobs)
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line 187, in __init__
    self.setup_extension(extension)
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line 411, in setup_extension
    self.registry.load_extension(self, extname)
  File "/usr/lib/python3/dist-packages/sphinx/registry.py", line 315, in load_extension
    mod = __import__(extname, None, None, ['setup'])
  File "/usr/lib/python3/dist-packages/sphinx/builders/applehelp.py", line 20, in <module>
    from sphinx.builders.html import StandaloneHTMLBuilder
  File "/usr/lib/python3/dist-packages/sphinx/builders/html.py", line 43, in <module>
    from sphinx.util import jsonimpl, logging, status_iterator
  File "/usr/lib/python3/dist-packages/sphinx/util/jsonimpl.py", line 22, in <module>
    class SphinxJSONEncoder(json.JSONEncoder):
TypeError: __mro_entries__ must return a tuple
```

The json module is a standard module. I is always present. So do not mock it.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:27:54 +01:00
Cédric Bosdonnat
4acaf459b4 Fix sphynx error about tornado.version_info
This is fix errors like the following when building docs:

WARNING: autodoc: failed to import module 'salt.states.saltmod'; the following exception was raised:
Traceback (most recent call last):
  File "/public/src/salt/env/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 140, in import_module
    __import__(modname)
  File "/public/src/salt/salt/states/saltmod.py", line 36, in <module>
    import salt.output
  File "/public/src/salt/salt/output/__init__.py", line 19, in <module>
    import salt.loader
  File "/public/src/salt/salt/loader.py", line 23, in <module>
    import salt.config
  File "/public/src/salt/salt/config/__init__.py", line 27, in <module>
    import salt.utils.network
  File "/public/src/salt/salt/utils/network.py", line 35, in <module>
    import salt.utils.zeromq
  File "/public/src/salt/salt/utils/zeromq.py", line 39, in <module>
    if tornado.version_info < (5,):
TypeError: '<' not supported between instances of 'Mock' and 'tuple'

(cherry picked from commit 8199700fdb)
2018-12-19 12:13:09 +01:00
Erik Johnson
678a75b2a1
Merge remote-tracking branch 'upstream/2018.3' into fluorine 2018-11-21 07:31:51 -06:00
Erik Johnson
ba82b0748a
Merge remote-tracking branch 'upstream/2017.7' into merge-2018.3 2018-11-21 07:19:22 -06:00
Erik Johnson
8127dd5bb4
Disable unused shorturls plugin
It was causing build errors when SPHINXOPTS=-W is used
2018-11-20 18:21:25 -06:00
Erik Johnson
1d39f88301
Make fluorine docs use the latest available release for download links 2018-11-14 12:45:05 -06:00
Erik Johnson
06be9d2896
Disable custom sphinx automodule
This causes a warning and doesn't provide a tangible benefit since we
have CLI examples for functions.
2018-11-13 14:53:13 -06:00
Erik Johnson
62b5d400b6
Disable custom sphinx automodule
This causes a warning and doesn't provide a tangible benefit since we
have CLI examples for functions.
2018-11-13 14:51:12 -06:00
Erik Johnson
8a2c08f683
Disable custom sphinx automodule
This causes a warning and doesn't provide a tangible benefit since we
have CLI examples for functions.
2018-11-13 13:25:58 -06:00
Ch3LL
f83460da62
change order of search engine ids 2018-10-25 16:47:46 -04:00
Ch3LL
bf3f21721e
Update search engine IDs for releases 2018-10-25 16:47:41 -04:00
rallytime
d8e5e9ea49
Merge branch '2018.3' into 'fluorine'
No conflicts.
2018-10-25 16:16:10 -04:00
Ch3LL
3452d9bf01
change order of search engine ids 2018-10-25 16:11:35 -04:00
Ch3LL
c9546dfb08
Update search engine IDs for releases 2018-10-25 16:10:15 -04:00
rallytime
8fed338708
Merge branch '2018.3' into 'fluorine'
Conflicts:
  - salt/spm/pkgfiles/local.py
  - salt/utils/schedule.py
  - tests/integration/scheduler/test_eval.py
2018-10-25 10:31:06 -04:00
Nicole Thomas
88673ad9e7
Merge pull request #50208 from Ch3LL/2update_version_doc_2018.3
Update release versions for the 2018.3 branch
2018-10-24 11:52:18 -04:00
Nicole Thomas
85e22d2f25
Merge pull request #50207 from Ch3LL/2update_version_doc_2017.7
Update release versions for the 2017.7 branch
2018-10-24 11:51:12 -04:00
Ch3LL
cdbf493400
Add 2017.7.8 previous release 2018-10-24 10:39:04 -04:00
Ch3LL
198d25ca1d
Add 2017.7.8 previous release 2018-10-24 10:38:37 -04:00
Ch3LL
6f775e748a
Update release versions for the 2018.3 branch 2018-10-24 10:34:26 -04:00
Ch3LL
d4e26aceda
Update release versions for the 2017.7 branch 2018-10-24 10:34:24 -04:00
rallytime
9298304ce9
Merge branch '2018.3' into 'fluorine'
No conflicts.
2018-09-19 14:07:06 -04:00
rallytime
b39dacf06c
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/pillar/cmd_yamlex.py
2018-09-18 10:08:16 -04:00
Erik Johnson
7e5bab78c5
Fix docs build errors (2017.7 branch) 2018-09-17 22:35:08 -06:00
Ch3LL
3cf335b0b9
Update release versions for the 2017.7 branch 2018-07-03 09:37:58 -04:00
Ch3LL
84a1994110
Update release versions for the 2018.3 branch 2018-07-03 09:35:12 -04:00
Ch3LL
6956e4e8ae
Update release versions for the develop branch 2018-06-29 16:41:40 -04:00
Megan Wilhite
53b4c4dc00
Merge pull request #48325 from Ch3LL/update_version_doc_develop
Update release versions for the develop branch
2018-06-27 09:44:06 -04:00
Ch3LL
b4dc1f8c71
Update release versions for the develop branch 2018-06-26 15:51:59 -04:00
Ch3LL
b4548aca56
Update release versions for the 2018.3 branch 2018-06-26 15:51:53 -04:00
Ch3LL
47845ba810
Update release versions for the 2017.7 branch 2018-06-26 15:51:46 -04:00
Erik Johnson
17f7b18da1
Sort and update mocks in doc configuration 2018-06-26 14:00:02 -05:00
Cédric Bosdonnat
b1c685d7f1
doc: mock boto.regioninfo._load_json_file
Mockup _load_json_file() in order to avoid the following errors when
building the docs:

WARNING: autodoc: failed to import module 'salt.modules.boto_asg'; the following exception was raised:
Traceback (most recent call last):
  File "/public/src/salt/env/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 140, in import_module
    __import__(modname)
  File "/public/src/salt/salt/modules/boto_asg.py", line 63, in <module>
    import boto.ec2
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/ec2/__init__.py", line 31, in <module>
    RegionData = load_regions().get('ec2', {})
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/regioninfo.py", line 100, in load_regions
    endpoints = _load_builtin_endpoints()
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/regioninfo.py", line 128, in _load_builtin_endpoints
    resolver = BotoEndpointResolver(endpoints)
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/endpoints.py", line 150, in __init__
    endpoint_data, service_rename_map)
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/endpoints.py", line 44, in __init__
    super(_CompatEndpointResolver, self).__init__(endpoint_data)
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/vendored/regions/regions.py", line 95, in __init__
    raise ValueError('Missing "partitions" in endpoint data')
ValueError: Missing "partitions" in endpoint data
2018-06-22 10:51:48 +02:00
Cédric Bosdonnat
8199700fdb
Fix sphynx error about tornado.version_info
This is fix errors like the following when building docs:

WARNING: autodoc: failed to import module 'salt.states.saltmod'; the following exception was raised:
Traceback (most recent call last):
  File "/public/src/salt/env/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 140, in import_module
    __import__(modname)
  File "/public/src/salt/salt/states/saltmod.py", line 36, in <module>
    import salt.output
  File "/public/src/salt/salt/output/__init__.py", line 19, in <module>
    import salt.loader
  File "/public/src/salt/salt/loader.py", line 23, in <module>
    import salt.config
  File "/public/src/salt/salt/config/__init__.py", line 27, in <module>
    import salt.utils.network
  File "/public/src/salt/salt/utils/network.py", line 35, in <module>
    import salt.utils.zeromq
  File "/public/src/salt/salt/utils/zeromq.py", line 39, in <module>
    if tornado.version_info < (5,):
TypeError: '<' not supported between instances of 'Mock' and 'tuple'
2018-06-22 10:51:48 +02:00
rallytime
444f1cb9b8
Update release versions for the develop branch 2018-06-13 09:47:21 -04:00