Move minion event signing to a saner place.
Enable dropping messages when signature does not verify or when
minion is not adding the signature to its payloads.
This fixes a problem when you make a request to salt-api using the /jobs
endpoint and request a JSON return. json.dumps() fails to serialize the
binary data entered into the job cache from salt-cp calls.
The existing logic assumes that showdupesfromrepos=0, in which a package
will not be shown if it is not an upgrade. This expands the version
check to include versions equal to the installed version, which will
keep the _check_cur() helper from incorrectly reporting that an
already-installed version is an upgrade.
This breaks the files into chunks to keep them from exceeding the max size
of a published command. It also adds recursion, allowing for entire
directories to be transmitted. Finally, it adds gzip compression, and
a "-n" flag to disable use of compression.
This fixes an edge case where an env blacklist/whitelist was updated
between masterless runs, or in later releases if an environment was
added via per-saltenv configuration. In these cases, if there are no
changes fetched, the env cache will remain intact, and will be returned
when envs() is called. This commit forces the env cache to be refreshed
on every update in masterless mode.
It also forces the env cache to be ignored when
salt.fileserver.Fileserver.envs() is executed in masterless mode (such
as via the fileserver.envs runner).
The "head_ref" variable is not used anywhere in the code, and should
be "head_rev" instead. Without setting "head_rev" to "None", there is
a potential to hit an UnboundLocalError further down in the file.
This was caught by a test in the nitrogen branch, but the bug is present
on 2016.11 as well. Here's the output from the integration test failure:
```
-> integration.states.test_git.GitTest.test_latest_updated_remote_rev .........................................
Traceback (most recent call last):
File "/testing/tests/integration/states/test_git.py", line 365, in test_latest_updated_remote_rev
self.assertSaltTrueReturn(ret)
File "/testing/tests/support/mixins.py", line 547, in assertSaltTrueReturn
**(next(six.itervalues(ret)))
AssertionError: False is not True. Salt Comment:
An exception occurred in this state: Traceback (most recent call last):
File "/testing/salt/state.py", line 1822, in call
**cdata['kwargs'])
File "/testing/salt/loader.py", line 1727, in wrapper
return f(*args, **kwargs)
File "/testing/salt/states/git.py", line 727, in latest
if head_rev is not None:
UnboundLocalError: local variable 'head_rev' referenced before assignment
```