If this is has any unicode characters in it, it won't load on systems that do
not default to a unicode locale.
find . -type f | while read line; do ret=$(file $line); if [[ $ret == *UTF-8* && $line == *.py ]]; then echo $line; fi; done
The above will list all files that have unicode characters in it and won't load
with locale set to C or POSIX
This fixes the test failures recently observed in
integration.shell.test_master.MasterTest.test_exit_status_correct_usage.
The test failures were not a regression, but rather a symptom of a
greater problem with the TestProgram class' shutdown() func. When
terminating the process using the terminate_process helper from
pytest-salt, it does not pass kill_children, which defaults to False.
This makes the helper only kill the main PID, leaving all the other PIDs
running.
This means that every time the integration suite was being run, each
time the TestProgram class was used to spawn a temporary daemon, it
would leave all the child PIDs running when the shutdown() is invoked.
By passing kill_children=True, we ensure that the child PIDs are also
killed. This should provide a significant perfomance improvement in the
test suite.
Either the get_cli_event_returns generator is not returning events, or
the events being yielded otherwise are evaluating as False. This line of
debugging code will help determine which is the case.
This adds some debug logging which we can hopefully use to troubleshoot
https://github.com/saltstack/salt-jenkins/issues/341.
Also, this ensures that the lists of up/down minions are always sorted.
This will make future testing more reliable.
The .keys() function itself is fine, it's just what we do after calling
it that matters. Anywhere we try to index the dictionary view will
stacktrace in PY3.
The third argument that is passed to the salt.utils.cloud.filter_event
function is supposed to be a list. Most of the places calling this function
were using `foo.keys()`, which returns a list in PY2. But, in PY3, this
is a dictionary view.
This change updates the places where `filter_event` is using `.keys()` and
instead wraps the dict with list(). It also adds some extra type checking
in the filter_event function in case a list is not passed in.
tls module: convert bytes to string
gzip util: use BytesIO for 'wb' file
django module: ignore arguments order in assert
pillar module: correctly test pillar merge
Having always alive sessions introduces many issues
when working with legacy equipment. One of them
being that the device can decide by itself to kill
the connection, the sole reasons being lack of activity
on the CLI. (Especially when working with ancient
operating systems such Cisco IOS).
In that case, whenever we detect that the connection
was dropped, we'll try re-establishing the connection.
But it won't go through a loop, will try just once,
if still unable to execute anything, will fail loudly.
When working with SSH-based drivers, the Paramiko
is_alive flag doesn't help much, as the dumb device
doesn't close the connection properly.