saltstack/salt — Issue #747: cp.get_file returns positive output when fileserver path is invalid
Author: archtaku
Created: 2012-02-24 01:10:24+00:00
State: open

cp.get_file will return the destination path even when the salt:// file URI is invalid. Additionally, a zero-size file is created on the minion.

When the path is invalid, no file should be created on the minion, and the module should return an empty string, or something else that can be evaluated for truth, so that you can do the following:

if not __salt__['cp.get_file']('salt://some/bogus/path','/tmp/filename'):
log.error('hey, the file isn't there!')