Improve error message when ext_pillar is incorrectly formatted

This catches a TypeError and adds a sane error message to the pre-flight
check.
This commit is contained in:
Erik Johnson 2018-07-05 11:11:10 -05:00
parent 84fd3d2784
commit 269dbab7f6
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -588,11 +588,19 @@ class Master(SMaster):
pass
if self.opts.get('git_pillar_verify_config', True):
git_pillars = [
x for x in self.opts.get('ext_pillar', [])
if 'git' in x
and not isinstance(x['git'], six.string_types)
]
try:
git_pillars = [
x for x in self.opts.get('ext_pillar', [])
if 'git' in x
and not isinstance(x['git'], six.string_types)
]
except TypeError:
git_pillars = []
critical_errors.append(
'Invalid ext_pillar configuration. It is likely that the '
'external pillar type was not specified for one or more '
'external pillars.'
)
if git_pillars:
try:
new_opts = copy.deepcopy(self.opts)