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>
* Add git.diff function
* Fail git.latest states with uncommitted changes when force_reset=False
Also, discard these changes when running the state if force_reset=True.
* Add integration test for case where there are uncommitted changes
This ceph module depend upon a ceph configuration library python_ceph_cfg.
https://github.com/oms4suse/python-ceph-cfg
This code was originally developed in the sesceph module:
https://github.com/oms4suse/sesceph
It contains contributions from:
Alex Lau (AvengerMoJo) <AvengerMoJo@gmail.com>
Jan Fajerski <jfajerski@suse.com>
Signed-off-by: Owen Synge <osynge@suse.com>