Skip to content

Fix 64624 document symbolic mode limitation #67928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/64624.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds documentation notes to clarify that Salt's file module only supports numeric mode specifications and does not support symbolic modes.
14 changes: 14 additions & 0 deletions salt/states/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ def run():
value in single quotes. If the value is not wrapped in quotes it
will be read by YAML as an integer and evaluated as an octal.

.. note::
Salt only supports numeric mode specifications (like ``644``)
and does not support symbolic modes (like ``u+rw``) that are commonly used
with commands like ``chmod``.

The ``names`` parameter, which is part of the state compiler, can be used to
expand the contents of a single state declaration into multiple, single state
declarations. Each item in the ``names`` list receives its own individual state
Expand Down Expand Up @@ -2556,6 +2561,11 @@ def managed(
.. note::
This option is **not** supported on Windows.

.. note::
Salt's file module only supports numeric mode specifications
(like ``644``) and does not support symbolic modes (like ``u+rw``)
that are commonly used with commands like ``chmod``.

.. versionchanged:: 2016.11.0
This option can be set to ``keep``, and Salt will keep the mode
from the Salt fileserver. This is only supported when the
Expand Down Expand Up @@ -3851,6 +3861,10 @@ def directory(
The default mode for new files and directories corresponds umask of salt
process. For existing files and directories it's not enforced.

The file module only supports numeric mode specifications (like ``644``)
and does not support symbolic modes like ``u+rw``) that are commonly
used with commands like ``chmod``.

makedirs
If the directory is located in a path without a parent directory, then
the state will fail. If makedirs is set to True, then the parent
Expand Down