mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #16102 from cachedout/issue_16073
Catch invalid saltenv
This commit is contained in:
commit
ad42cd1670
@ -2658,10 +2658,13 @@ class BaseHighState(object):
|
||||
highstate = self.building_highstate
|
||||
all_errors = []
|
||||
mods = set()
|
||||
statefiles = []
|
||||
for saltenv, states in matches.items():
|
||||
for sls_match in states:
|
||||
statefiles = fnmatch.filter(self.avail[saltenv], sls_match)
|
||||
|
||||
try:
|
||||
statefiles = fnmatch.filter(self.avail[saltenv], sls_match)
|
||||
except KeyError:
|
||||
all_errors.extend(['No matching salt environment for environment {0!r} found'.format(saltenv)])
|
||||
# if we did not found any sls in the fileserver listing, this
|
||||
# may be because the sls was generated or added later, we can
|
||||
# try to directly execute it, and if it fails, anyway it will
|
||||
|
Loading…
Reference in New Issue
Block a user