mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Better message when minion fail to start
When minion fail to start due to issues related to log path, print a better message to help fix it. Fixes #32255.
This commit is contained in:
parent
664043d7e7
commit
4c72adc03a
2 changed files with 5 additions and 2 deletions
|
@ -80,7 +80,7 @@ def minion_process(queue):
|
|||
minion = salt.cli.daemons.Minion()
|
||||
minion.start()
|
||||
except (Exception, SaltClientError, SaltReqTimeoutError, SaltSystemExit) as exc:
|
||||
log.error('Minion failed to start', exc_info=False)
|
||||
log.error('Minion failed to start: {0}'.format(exc.message), exc_info=False)
|
||||
restart = True
|
||||
except SystemExit as exc:
|
||||
restart = False
|
||||
|
|
|
@ -23,7 +23,7 @@ else:
|
|||
|
||||
# Import salt libs
|
||||
from salt.log import is_console_configured
|
||||
from salt.exceptions import SaltClientError
|
||||
from salt.exceptions import SaltClientError, SaltSystemExit
|
||||
import salt.defaults.exitcodes
|
||||
import salt.utils
|
||||
|
||||
|
@ -173,6 +173,9 @@ def verify_files(files, user):
|
|||
fp_.write('')
|
||||
|
||||
except IOError as err:
|
||||
if os.path.isfile(dirname):
|
||||
msg = 'Failed to create path {0}, is {1} a file?'.format(fn_, dirname)
|
||||
raise SaltSystemExit(msg=msg)
|
||||
if err.errno != errno.EACCES:
|
||||
raise
|
||||
msg = 'No permissions to access "{0}", are you running as the correct user?\n'
|
||||
|
|
Loading…
Add table
Reference in a new issue