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:
Jacek Tomasiak 2017-02-23 12:06:46 +01:00
parent 5987c4e30e
commit baf84b4430

View file

@ -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: