Skip to content

Commit

Permalink
Catch FileserverConfigError exceptions on master startup
Browse files Browse the repository at this point in the history
This causes the master to fail to start when there are fileserver config
issues, leading people quicker to the log to investigate, where they
will find a meaningful error message. This should it much quicker and
easier for users to realize there are gitfs/hgfs/svnfs fileserver config
problems.

Fixes saltstack#21021.
  • Loading branch information
terminalmage authored and cro committed Feb 27, 2015
1 parent d3847d4 commit 6be3bff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions salt/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,13 @@ def _pre_flight(self):
'Failed to load fileserver backends, the configured backends '
'are: {0}'.format(', '.join(self.opts['fileserver_backend']))
)
else:
# Run init() for all backends which support the function, to
# double-check configuration
try:
fileserver.init()
except FileserverConfigError as exc:
errors.append('{0}'.format(exc))
if not self.opts['fileserver_backend']:
errors.append('No fileserver backends are configured')
if errors:
Expand Down

0 comments on commit 6be3bff

Please sign in to comment.