Building the documentation with the Python 3 version of sphinx fails:
$ make -C doc html SPHINXBUILD=/usr/share/sphinx/scripts/python3/sphinx-build
[...]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/sphinx/cmdline.py", line 296, in main
app.build(opts.force_all, filenames)
File "/usr/lib/python3/dist-packages/sphinx/application.py", line 333, in build
self.builder.build_update()
File "/usr/lib/python3/dist-packages/sphinx/builders/__init__.py", line 251, in build_update
'out of date' % len(to_build))
File "/usr/lib/python3/dist-packages/sphinx/builders/__init__.py", line 265, in build
self.doctreedir, self.app))
File "/usr/lib/python3/dist-packages/sphinx/environment/__init__.py", line 556, in update
self._read_serial(docnames, app)
File "/usr/lib/python3/dist-packages/sphinx/environment/__init__.py", line 576, in _read_serial
self.read_doc(docname, app)
File "/usr/lib/python3/dist-packages/sphinx/environment/__init__.py", line 684, in read_doc
pub.publish()
File "/usr/lib/python3/dist-packages/docutils/core.py", line 217, in publish
self.settings)
File "/usr/lib/python3/dist-packages/sphinx/io.py", line 55, in read
self.parse()
File "/usr/lib/python3/dist-packages/docutils/readers/__init__.py", line 78, in parse
self.parser.parse(self.input, document)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/__init__.py", line 191, in parse
self.statemachine.run(inputlines, document, inliner=self.inliner)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 172, in run
input_source=document['source'])
File "/usr/lib/python3/dist-packages/docutils/statemachine.py", line 239, in run
context, state, transitions)
File "/usr/lib/python3/dist-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 2989, in text
self.section(title.lstrip(), source, style, lineno + 1, messages)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 328, in section
self.new_subsection(title, lineno, messages)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 396, in new_subsection
node=section_node, match_titles=True)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 283, in nested_parse
node=node, match_titles=match_titles)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 197, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/usr/lib/python3/dist-packages/docutils/statemachine.py", line 239, in run
context, state, transitions)
File "/usr/lib/python3/dist-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 2754, in underline
self.section(title, source, style, lineno - 1, messages)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 328, in section
self.new_subsection(title, lineno, messages)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 396, in new_subsection
node=section_node, match_titles=True)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 283, in nested_parse
node=node, match_titles=match_titles)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 197, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/usr/lib/python3/dist-packages/docutils/statemachine.py", line 239, in run
context, state, transitions)
File "/usr/lib/python3/dist-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 2754, in underline
self.section(title, source, style, lineno - 1, messages)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 328, in section
self.new_subsection(title, lineno, messages)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 396, in new_subsection
node=section_node, match_titles=True)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 283, in nested_parse
node=node, match_titles=match_titles)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 197, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/usr/lib/python3/dist-packages/docutils/statemachine.py", line 239, in run
context, state, transitions)
File "/usr/lib/python3/dist-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 2327, in explicit_markup
nodelist, blank_finish = self.explicit_construct(match)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 2339, in explicit_construct
return method(self, expmatch)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 2082, in directive
directive_class, match, type_name, option_presets)
File "/usr/lib/python3/dist-packages/docutils/parsers/rst/states.py", line 2131, in run_directive
result = directive_instance.run()
File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc.py", line 1668, in run
documenter.generate(more_content=self.content)
File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc.py", line 1013, in generate
self.document_members(all_members)
File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc.py", line 1388, in document_members
ModuleLevelDocumenter.document_members(self, all_members)
File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc.py", line 903, in document_members
for (mname, member, isattr) in self.filter_members(members, want_all):
File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc.py", line 871, in filter_members
not keep, self.options)
File "/usr/lib/python3/dist-packages/sphinx/application.py", line 593, in emit_firstresult
for result in self.emit(event, *args):
File "/usr/lib/python3/dist-packages/sphinx/application.py", line 589, in emit
results.append(callback(self, *args))
File "/usr/lib/python3/dist-packages/sphinx/ext/napoleon/__init__.py", line 426, in _skip_member
cls_path, _, _ = qualname.rpartition('.')
ValueError: not enough values to unpack (expected 3, got 0)
The napoleon sphinx extensions queries the attribute __qualname__ of the
given obj and expect a string as result. It uses a default value if this
attribute does not exist. The real Python modules do not have a
__qualname__ attribute, but the doc.conf.Mock object returns a Mock
object when queried for the __qualname__ attribute. Change the Mock
object to raise an AttributeError instead. This fixes#45684.
When using Python 3 to generate the documentation, it will fail:
$ make -C doc html SPHINXBUILD=/usr/share/sphinx/scripts/python3/sphinx-build
[...]
File "salt/config/__init__.py", line 84, in _gather_buffer_space
if HAS_PSUTIL and psutil.version_info >= (0, 6, 0):
TypeError: '>=' not supported between instances of 'Mock' and 'tuple'
Therefore add fake version variables to the mocked msgpack and psutil
module.
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
The salt/sdb/keyring_db.py
Traceback (most recent call last):
File "salt/sdb/keyring_db.py", line 53, in <module>
import keyring
File "/usr/lib/python2.7/dist-packages/keyring/__init__.py", line 6, in <module>
from .core import (set_keyring, get_keyring, set_password, get_password,
File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 148, in <module>
init_backend()
File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 64, in init_backend
keyrings = filter(limit, backend.get_all_keyring())
File "/usr/lib/python2.7/dist-packages/keyring/util/__init__.py", line 20, in wrapper
func.always_returns = func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/keyring/backend.py", line 191, in get_all_keyring
exceptions=TypeError))
File "/usr/lib/python2.7/dist-packages/keyring/util/__init__.py", line 29, in suppress_exceptions
for callable in callables:
File "/usr/lib/python2.7/dist-packages/keyring/backend.py", line 183, in is_class_viable
keyring_cls.priority
File "/usr/lib/python2.7/dist-packages/keyring/util/properties.py", line 22, in __get__
return self.fget.__get__(None, owner)()
File "/usr/lib/python2.7/dist-packages/keyring/backends/kwallet.py", line 128, in priority
return super(DBusKeyringKWallet4, cls).priority - 1
File "/usr/lib/python2.7/dist-packages/keyring/util/properties.py", line 22, in __get__
return self.fget.__get__(None, owner)()
File "/usr/lib/python2.7/dist-packages/keyring/backends/kwallet.py", line 31, in priority
bus = dbus.SessionBus(mainloop=DBusGMainLoop())
NameError: global name 'DBusGMainLoop' is not defined
Therefore also mock the keyring module when generating the
documentation. This fixes#45072.
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
The winrepo_source_dir minion config can be set with or without a master. It is currently documented as only available if the minion is running in masterless mode. I have updated the documentation to reflect that it will work in master or masterless mode.
Without allow_unicode=True, unicode characters are processed through the
str representer and on Python 2 are dumped as a Unicode code point (i.e.
a literal \u0414). This commit makes allow_unicode=True the default in
our salt.utils.yamlloader.safe_dump() helper. It also adds a new
salt.utils.yamlloader.dump() helper which wraps yaml.dump() and also
makes allow_unicode=True the default.
To make importing and using our custom yaml loader/dumper easier, a
convenience module called salt.utils.yaml has been added, which does a
wildcard import from both salt.utils.yamldumper and
salt.utils.yamlloader.
Refs to yaml.load/dump and yaml.safe_load/safe_dump have been updated to
salt.utils.yaml, to ensure that unicode is handled properly.
This updates the file state and execution modules to use
unicode_literals. Since the serializers and the cmd module are touched
by the file state/exec module, those are also updated here, as well as
the cmd state module, for good measure.
Additionally, I found that salt.utils.data.decode_dict (and decode_list)
are misnamed for what they actually do. Since they *encode* the
contents, the functions should be named encode_dict and encode_list,
respectively. And we also should have counterparts which actually
decode, so I've added them. The compatibility functions from salt.utils
still use the old "decode" names to preserve backward compatibility, but
they now invoke the renamed "encode" functions in salt.utils.data. Note
that this means that the compatibility functions
salt.utils.decode_dict/list, and their cognates in salt.utils.data now
do different things, but since the move to salt.utils.data is also
happening in the Oxygen release this is as good a time as any to correct
this oversight.
I've updated the jinja filter docs to include information on the renamed
jinja filters, and also added a section on jinja filter renaming to the
Oxygen release notes. There was another filter that I renamed during the
process of moving functions from salt.utils which I did not properly
document in the release notes, so this is now included along with the
others.
Much Improved Support for Docker Networking
===========================================
The `docker_network.present` state has undergone a full rewrite, which
includes the following improvements:
Full API Support for Network Management
---------------------------------------
The improvements made to input handling in the
`docker_container.running` state for 2017.7.0 have now been expanded to
docker_network.present`. This brings with it full support for all
tunable configuration arguments.
Custom Subnets
--------------
Custom subnets can now be configured. Both IPv4 and mixed IPv4/IPv6
networks are supported.
Network Configuration in :py:func:`docker_container.running` States
-------------------------------------------------------------------
It is now possible to configure static IPv4/IPv6 addresses, as well as
links and labels.
Improved Handling of Images from Custom Registries
==================================================
Rather than attempting to parse the tag from the passed image name, Salt
will now resolve that tag down to an image ID and use that ID instead.
Due to this change, there are some backward-incompatible changes to
image management. See below for a full list of these changes.
Backward-incompatible Changes to Docker Image Management
--------------------------------------------------------
Passing image names to the following functions must now be done using separate
`repository` and `tag` arguments:
- `docker.build`
- `docker.commit`
- `docker.import`
- `docker.load`
- `docker.tag`
- `docker.sls_build`
Additionally, the `tag` argument must now be explicitly passed to the
`docker_image.present` state, unless the image is being pulled from a
docker registry.