virt.init knows how to set the boot device order for a while, but this
feature never came to virt.running. This commit is fixing this omission
and adds it for both virt.running and virt.defined states.
The libvirt constants for pool and nodedev events need tweaking since
they don't match the rule used to autogenerate them. Fixes these warnings
at the engine start.
Skipping "pool/lifecycle" events: libvirt too old
Skipping "pool/refresh" events: libvirt too old
Skipping "nodedev/lifecycle" events: libvirt too old
Skipping "nodedev/update" events: libvirt too old
Also remove a bunch of needless calls to "keys", as membership checks
for dicts are more efficient using the built-in dict membership check,
which utilizes hashing instead of iterating over the keys.
Otherwise a race can happen between Salt processes and results in unpack error:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/pillar/__init__.py", line 745, in render_pstate
**defaults)
File "/usr/lib/python3/dist-packages/salt/template.py", line 101, in compile_template
ret = render(input_data, saltenv, sls, **render_kwargs)
File "/usr/lib/python3/dist-packages/salt/renderers/gpg.py", line 378, in render
return _decrypt_object(gpg_data, translate_newlines=translate_newlines, encoding=kwargs.get('encoding', None))
File "/usr/lib/python3/dist-packages/salt/renderers/gpg.py", line 357, in _decrypt_object
translate_newlines=translate_newlines)
File "/usr/lib/python3/dist-packages/salt/renderers/gpg.py", line 353, in _decrypt_object
return _decrypt_ciphertexts(obj, translate_newlines=translate_newlines, encoding=encoding)
File "/usr/lib/python3/dist-packages/salt/renderers/gpg.py", line 328, in _decrypt_ciphertexts
ret, num = GPG_CIPHERTEXT.subn(replace, to_bytes(cipher))
File "/usr/lib/python3/dist-packages/salt/renderers/gpg.py", line 325, in replace
result = to_bytes(_decrypt_ciphertext(match.group()))
File "/usr/lib/python3/dist-packages/salt/renderers/gpg.py", line 298, in _decrypt_ciphertext
cache = _get_cache()
File "/usr/lib/python3/dist-packages/salt/renderers/gpg.py", line 280, in _get_cache
minion_cache_path=os.path.join(cachedir, 'gpg_cache')
File "/usr/lib/python3/dist-packages/salt/utils/cache.py", line 37, in factory
return CacheDisk(ttl, kwargs['minion_cache_path'], *args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/utils/cache.py", line 90, in __init__
self._read()
File "/usr/lib/python3/dist-packages/salt/utils/cache.py", line 138, in _read
cache = salt.utils.data.decode(salt.utils.msgpack.load(fp_, encoding=__salt_system_encoding__))
File "/usr/lib/python3/dist-packages/salt/utils/msgpack.py", line 116, in unpack
return msgpack.unpack(stream, **_sanitize_msgpack_kwargs(kwargs))
File "/usr/lib/python3/dist-packages/msgpack/__init__.py", line 58, in unpack
return unpackb(data, **kwargs)
File "msgpack/_unpacker.pyx", line 211, in msgpack._unpacker.unpackb
msgpack.exceptions.UnpackValueError: Unpack failed: error = 0