def upload(local_path, remote_path, ip): @hosts(ip) def _inner_task(): run('mkdir -p {}'.format(remote_path)) put(local_path, remote_path) execute(_inner_task)