Building the documentation locally without Internet access will fail,
because sphinx will try to download the intersphinx inventory from
http://docs.python.org/3/objects.inv.
Support building the documentation locally without Internet access by
searching for locally installed intersphinx inventory first.
Bug-Debian: https://bugs.debian.org/755026
Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
* Fixing various redirected links
* Change links to https
* Reintroduced macro link reference
* Change man page to original at master; revert added line
Importing kubernetesmod fails, when building the documentation:
```
doc/ref/modules/all/index.rst:20: WARNING: failed to import kubernetesmod
doc/ref/modules/all/index.rst:20: WARNING: toctree references unknown document 'ref/modules/all/kubernetesmod'
WARNING: autodoc: failed to import module 'kubernetesmod' from module
'salt.modules'; the following exception was raised:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc/importer.py", line 154, in import_module
__import__(modname)
File "salt/modules/kubernetesmod.py", line 71, in <module>
import kubernetes # pylint: disable=import-self
File "/usr/lib/python3/dist-packages/kubernetes/__init__.py", line 20, in <module>
import kubernetes.config
File "/usr/lib/python3/dist-packages/kubernetes/config/__init__.py", line 17, in <module>
from .kube_config import (list_kube_config_contexts, load_kube_config,
File "/usr/lib/python3/dist-packages/kubernetes/config/kube_config.py", line 27, in <module>
from requests_oauthlib import OAuth2Session
File "/usr/lib/python3/dist-packages/requests_oauthlib/__init__.py", line 11, in <module>
if requests.__version__ < '2.0.0':
TypeError: '<' not supported between instances of 'module' and 'str'
```
Therefore also mock `kubernetes` and `kubernetes.config`.
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
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>
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>
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>
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>