file_map: chmod created directories if not root

This commit is contained in:
Kaido Kert 2015-05-12 09:11:17 -10:00 committed by rallytime
parent 13facbf077
commit fe3a762673

View file

@ -1084,6 +1084,13 @@ def deploy_script(host,
if remote_dir not in remote_dirs:
root_cmd('mkdir -p \'{0}\''.format(remote_dir), tty, sudo, **ssh_kwargs)
if ssh_kwargs['username'] != 'root':
root_cmd(
'chown {0} \'{1}\''.format(
ssh_kwargs['username'], remote_dir
),
tty, sudo, **ssh_kwargs
)
remote_dirs.append(remote_dir)
sftp_file(
remote_file, kwargs=ssh_kwargs, local_file=local_file