check for sources before adding them to cmd str

Fixes #26093.
This commit is contained in:
Justin Findlay 2015-08-07 13:56:11 -06:00
parent dedcadc37e
commit 1b2f8905eb

View file

@ -103,7 +103,9 @@ def tar(options, tarfile, sources=None, dest=None,
cmd.extend(['-C', '{0}'.format(dest)])
cmd.extend(['-{0}'.format(options), '{0}'.format(tarfile)])
cmd.extend(sources)
if sources:
cmd.extend(sources)
return __salt__['cmd.run'](cmd,
cwd=cwd,