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>
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)
If the `pyvmomi` library is missing, all tests from the
tests.unit.modules.RemoveCapacityFromDiskgroupTestCase will fail:
```
ERROR: test__get_proxy_target_call
(unit.modules.test_vsphere.RemoveCapacityFromDiskgroupTestCase)
[CPU:0.0%|MEM:35.1%]
----------------------------------------------------------------------
Traceback (most recent call last):
File "salt/utils/vmware.py", line 485, in disconnect
Disconnect(service_instance)
NameError: name 'Disconnect' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "salt/modules/vsphere.py", line 381, in _gets_service_instance_via_proxy
salt.utils.vmware.disconnect(local_service_instance)
File "salt/utils/vmware.py", line 486, in disconnect
except vim.fault.NoPermission as exc:
NameError: name 'vim' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "salt/utils/vmware.py", line 485, in disconnect
Disconnect(service_instance)
NameError: name 'Disconnect' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tests/unit/modules/test_vsphere.py", line 1568, in test__get_proxy_target_call
capacity_disk_ids=['fake_disk1', 'fake_disk2'])
File "salt/modules/vsphere.py", line 295, in __supports_proxies
return fn(*args, **salt.utils.args.clean_kwargs(**kwargs))
File "salt/modules/vsphere.py", line 386, in _gets_service_instance_via_proxy
salt.utils.vmware.disconnect(local_service_instance)
File "/home/bdrung/projects/salt/debian/salt/utils/vmware.py", line 486, in disconnect
except vim.fault.NoPermission as exc:
NameError: name 'vim' is not defined
```
Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
Adds more policies
Fixes bug in netsh salt util
Uses __context__ to speed things up
Fixes bug in the state where it was reporting changes when no changes
occurred