Localectl outputs n/a sometimes when stuff is not set, instead of just not
outputting anything. Actually put None in the variable when parsing it, and do
not add it to the localectl set command.
To properly report on nodegroup minions which failed to return, the
master reports minions which don't match the target expression as
"missing". Later, when aggregating returns and writing them to the CLI,
failure events are fired for minions which were reported as missing.
The problem with this approach is that the lower-level minions do not
subscribe directly to the master-of-masters, and thus they are always
marked as missing.
To keep from falsely reporting them as missing, this commit filters out
any minion IDs for which a return was received, so that we only report
on minions which actually failed to return.
Virtual package detection was broken in #44455. This restores it for the
remainder of the 2018.3 release cycle, at which time it will be removed
altogether.
The file.patch integration tests were rewritten in the develop branch
in PR #47010
They came back in during the merge-forward and should have been removed
again during the merge conflict resolution.
When using hashlib and running `.hexdigest()`, a `str` type is returned.
It needs to be converted to a bytes type for the setsockopt a few lines
below, if zmq_filtering is enabled and the master is running Python 3.
Allow the user to provide connection, username and password as
function parameters to override the virt:connection and virt:auth
configuration. This way the configuration will be a default for
the minion, but other connections will still be reachable (issue 47156).
As an example, the configured connection could be the qemu:///system
one (would be found automatically anyway), and the user will be able
to handle her containers with calls like:
salt 'host' virt.list_domains connection=lxc:///
virt.nic is considered as the old version of virt:nic in the code, but
there is no warning of this. The documentation is also still mentioning
virt.nic. Updating it all to move to virt:nic
list_domain() should not be used internally to get domains as it usually
involves duplicate opened connections. Remove some more useless libvirt
connections by using _get_domain() instead.
list_domain opens two libvirt connections: one for active VMs and one
for inactive ones. Move all the logic in _get_domain() by adding two
possible kwargs ('active' and 'inactive'). With this only one connection
is required by this call and _get_domain should now be the function to
use internally to get domains.
Extract the code of get_nics, get_disks and get_graphics into private
functions providing the same feature with a libvirt domain as parameter.
The rationale behind this change is to allow reducing the number of
libvirt connections opened during some calls.