Do not raise an exception on check_cfg/mandatory=False/-vv #2193

This commit is contained in:
Thomas Nagy 2018-08-28 23:36:09 +02:00
parent f09a1c56ca
commit a97f6fb094
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
1 changed files with 3 additions and 4 deletions

View File

@ -358,13 +358,12 @@ def check_cfg(self, *k, **kw):
ret = None
try:
ret = self.exec_cfg(kw)
except self.errors.WafError:
except self.errors.WafError as e:
if 'errmsg' in kw:
self.end_msg(kw['errmsg'], 'YELLOW', **kw)
if Logs.verbose > 1:
raise
else:
self.fatal('The configuration failed')
self.to_log('Command failure: %s' % e)
self.fatal('The configuration failed')
else:
if not ret:
ret = True