diff --git a/doc/topics/development/modules/developing.rst b/doc/topics/development/modules/developing.rst index 5e9a9219ac4..82e8d793bc9 100644 --- a/doc/topics/development/modules/developing.rst +++ b/doc/topics/development/modules/developing.rst @@ -155,7 +155,7 @@ The following dunder dictionaries are always defined, but may be empty __opts__ -------- -..versionchanged:: 3006.0 +.. versionchanged:: 3006.0 The ``__opts__`` dictionary can now be accessed via :py:mod:`~salt.loader.context``. @@ -248,13 +248,6 @@ executions until the modules are refreshed; such as when :py:func:`saltutil.sync_all ` or :py:func:`state.apply ` are executed. -A great place to see how to use ``__context__`` is in the cp.py module in -salt/modules/cp.py. The fileclient authenticates with the master when it is -instantiated and then is used to copy files to the minion. Rather than create a -new fileclient for each file that is to be copied down, one instance of the -fileclient is instantiated in the ``__context__`` dictionary and is reused for -each file. Here is an example from salt/modules/cp.py: - .. code-block:: python if not "cp.fileclient" in __context__: @@ -303,3 +296,13 @@ Defined in: State __sdb__ ------- Defined in: SDB + + +__file_client__ +--------------- + +.. versionchanged:: 3006.5 + +The ``__file_client__`` dunder was added to states and execution modules. This +enables the use of a file client without haveing to instantiate one in +the module.