mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Ensure user/group/file_mode after line edit
Ownership parameters are used in `line` only when the file doesn't exist and `create` is enabled. After editing the file is saved with default ownership. `managed` already handles file existence and `create` internally so it can be called directly and will take care of the ownership and mode in all cases.
This commit is contained in:
parent
5987c4e30e
commit
baf84b4430
1 changed files with 1 additions and 2 deletions
|
@ -3178,8 +3178,7 @@ def line(name, content, match=None, mode=None, location=None,
|
|||
if not name:
|
||||
return _error(ret, 'Must provide name to file.line')
|
||||
|
||||
if create and not os.path.isfile(name):
|
||||
managed(name, create=create, user=user, group=group, mode=file_mode)
|
||||
managed(name, create=create, user=user, group=group, mode=file_mode)
|
||||
|
||||
check_res, check_msg = _check_file(name)
|
||||
if not check_res:
|
||||
|
|
Loading…
Add table
Reference in a new issue