Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactor: fix traceback when salt:// path is nonexistant #38875

Merged
merged 2 commits into from Jan 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions salt/modules/cp.py
Expand Up @@ -419,6 +419,9 @@ def cache_file(path, saltenv='base', env=None):
salt '*' cp.cache_file salt://foo/bar.conf saltenv=config
salt '*' cp.cache_file salt://foo/bar.conf?saltenv=config

If the path being cached is a ``salt://`` URI, and the path does not exist,
then ``False`` will be returned.

.. note::
It may be necessary to quote the URL when using the querystring method,
depending on the shell being used to run the command.
Expand Down
2 changes: 1 addition & 1 deletion salt/utils/reactor.py
Expand Up @@ -58,7 +58,7 @@ def render_reaction(self, glob_ref, tag, data):
react = {}

if glob_ref.startswith('salt://'):
glob_ref = self.minion.functions['cp.cache_file'](glob_ref)
glob_ref = self.minion.functions['cp.cache_file'](glob_ref) or ''
globbed_ref = glob.glob(glob_ref)
if not globbed_ref:
log.error('Can not render SLS {0} for tag {1}. File missing or not found.'.format(glob_ref, tag))
Expand Down