* add test module
* modify GCE tests to remove mocks
* use certifi, libcloud has also patched the SuSE/Mac cert issues
* skip cert checking
* validate the __virtual__ and import process
* fix munged merge
* fixed lint errors and failing test
* fix dimensiondata tests in the same way whilst I'm here
I have occasionally come across this error while running a salt-minion on
Windows using Python 3.5.1 and the TCP transport:
'''
File "...\salt\crypt.py", line 498, in _authenticate
if not error:
UnboundLocalError: local variable 'error' referenced before assignment
[WARNING ] Minion received a SIGINT. Exiting.
'''
It seems like there is an overloaded use of the local variable called
`error`, each use with a different lifespan. Changed it so that `error`
is no longer overloaded. This has fixed the issue.
Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
On Windows, only the main process properly logged to console and to
file. Things worked on other OSes due to the logging configuration
being propogated via fork, something that won't work on Windows.
The new strategy for Windows is if multiprocessing mode is used,
all console and file logging will be performed through the
Multiprocessing Logging Listener except for the main process. The
main process does not send stuff to the Multiprocessing Logging Listener.
Hence the main process will still configure file and console logging
separately from the MP Logging Listener.
If multiprocessing mode is off, then logging will be done as before
(which should be ok since there is only one process).
salt/utils/parsers.py:
- Broke apart the logic that figures out the input options for
`log.setup_logfile_logger` and `log.setup_console_logger`. This
functionality is run before `self._setup_mp_logging_listener` so that
the options passed to the MP Logging Listener are appropriate for direct
use in the functions that setup the console and file logging in the
MP Logging Listener process.
- Moved the logic that verifies the path for the log file from
`cli/daemons.py` to be able to run it before creating the MP Logging
Listener. Its original place in `cli/daemons.py` would run after the
MP Logging Listener is created.
salt/log/setup.py:
- Invoke `setup_console_logger` and `setup_logfile_logger` using the
appropriate options if running on Windows.
salt/minion.py:
- No longer need to invoke the functions to setup the console and file
logging on Windows multiprocessing mode due to the MP Logging
Listener taking care of that on Windows.
salt/cli/daemons.py:
- Moved the logic that verifies the path for the log file to
`utils/parsers.py`.
Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>