fileclient: Fix traceback when template file cannot be cached

When `cache_file` fails, `sfn` is `False`, which causes a traceback when
checking for the cached path's existence. This fixes that traceback.
This commit is contained in:
Erik Johnson 2019-03-07 11:05:52 -06:00
parent 01bcff087e
commit 744dfd9a9a

View file

@ -735,7 +735,7 @@ class Client(object):
kwargs['saltenv'] = saltenv
url_data = urlparse(url)
sfn = self.cache_file(url, saltenv, cachedir=cachedir)
if not os.path.exists(sfn):
if not sfn or not os.path.exists(sfn):
return ''
if template in salt.utils.templates.TEMPLATE_REGISTRY:
data = salt.utils.templates.TEMPLATE_REGISTRY[template](