From 2bf12b579e083a8b527d3202ced365b8adf32625 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Mon, 27 Apr 2020 11:46:51 +0100 Subject: template: T2388: move mkdir/chmod/chown within render() --- src/conf_mode/salt-minion.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/conf_mode/salt-minion.py') diff --git a/src/conf_mode/salt-minion.py b/src/conf_mode/salt-minion.py index dffe7fcd4..8bc35bb45 100755 --- a/src/conf_mode/salt-minion.py +++ b/src/conf_mode/salt-minion.py @@ -79,14 +79,8 @@ def generate(salt): if not salt: return None - for file in [config_file, master_keyfile]: - dirname = os.path.dirname(file) - if not os.path.exists(dirname): - os.mkdir(dirname) - chown(dirname, salt['user'], salt['group']) - - render(config_file, 'salt-minion/minion.tmpl', salt) - chown(config_file, salt['user'], salt['group']) + render(config_file, 'salt-minion/minion.tmpl', salt, + user=salt['user'], group=salt['group']) if not os.path.exists(master_keyfile): if salt['master_key']: -- cgit v1.2.3