Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an error message when invalid transport is set #36646

Merged
merged 1 commit into from Sep 28, 2016

Conversation

rallytime
Copy link
Contributor

@rallytime rallytime commented Sep 28, 2016

Fixes a bug where if transport: foo was set in the minion config file, the minion would stracktrace upon startup:

root@rallytime:~# salt-minion -ldebug
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG   ] Including configuration from '/etc/salt/minion.d/beacons.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/beacons.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: rallytime
[DEBUG   ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[INFO    ] Setting up the Salt Minion "rallytime"
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/root/SaltStack/salt/salt/scripts.py", line 110, in minion_process
    minion.start()
  File "/root/SaltStack/salt/salt/cli/daemons.py", line 344, in start
    super(Minion, self).start()
  File "/root/SaltStack/salt/salt/utils/parsers.py", line 942, in start
    self.prepare()
  File "/root/SaltStack/salt/salt/cli/daemons.py", line 329, in prepare
    import salt.daemons.flo
  File "/root/SaltStack/salt/salt/daemons/flo/__init__.py", line 26, in <module>
    from . import core
  File "/root/SaltStack/salt/salt/daemons/flo/core.py", line 23, in <module>
    from raet import raeting
ImportError: No module named raet

Instead of stacktracing, we should provide a helpful error to the user and then exit.

root@rallytime:~# salt-minion -ldebug
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG   ] Including configuration from '/etc/salt/minion.d/beacons.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/beacons.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: rallytime
[DEBUG   ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[INFO    ] Setting up the Salt Minion "rallytime"
[ERROR   ] The transport 'foo' is not supported. Please use one of the following: tcp, raet, or zeromq. Exiting.
[INFO    ] The salt minion is shutting down..
[INFO    ] The Salt Minion is shut down

Fixes #36304

@cro cro merged commit ab5c0e9 into saltstack:2016.3 Sep 28, 2016
@rallytime rallytime deleted the fix-36304 branch September 29, 2016 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants