You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
In some circumstances, the gpg.present state reports success even though the requested key is not present. This always happens when a result does not contain a user ID, not sure about other cases.
$ salt-call state.apply gpgtest[ERROR ] 'gpg.get_key': Falselocal:---------- ID: Receive key Function: gpg.present Name: B9B7A108373276BF3C0406F9FC8A7D14C3CD543A Result: True Comment: Adding B9B7A108373276BF3C0406F9FC8A7D14C3CD543A to GPG keychain Started: 01:03:12.679780 Duration: 333.338 ms Changes:---------- ID: Show shiny new key Function: module.run Result: False Comment: 'gpg.get_key': False Started: 01:03:13.014473 Duration: 8.633 ms Changes:Summary for local------------Succeeded: 1Failed: 1------------Total states run: 2Total run time: 341.971 ms
Expected behavior
The key to actually be present or reported failure.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
Salt: 3005.1Dependency Versions:
cffi: 1.14.6cherrypy: unknowndateutil: 2.8.1docker-py: Not Installedgitdb: 4.0.9gitpython: 3.1.29Jinja2: 3.1.0libgit2: Not InstalledM2Crypto: Not InstalledMako: Not Installedmsgpack: 1.0.2msgpack-pure: Not Installedmysql-python: Not Installedpycparser: 2.21pycrypto: Not Installedpycryptodome: 3.9.8pygit2: Not InstalledPython: 3.9.14 (main, Sep 27 2022, 00:00:00)python-gnupg: 0.4.8PyYAML: 5.4.1PyZMQ: 23.2.0smmap: 5.0.0timelib: 0.2.4Tornado: 4.5.3ZMQ: 4.3.4System Versions:
dist: rocky 9.0 Blue Onyxlocale: utf-8machine: x86_64release: 5.14.0-70.26.1.el9_0.x86_64system: Linuxversion: Rocky Linux 9.0 Blue Onyx
Additional context gpg.present does not ensure presence turned out to be multiple problems:
Description
In some circumstances, the
gpg.present
state reports success even though the requested key is not present. This always happens when a result does not contain a user ID, not sure about other cases.Setup
Steps to Reproduce the behavior
Expected behavior
The key to actually be present or reported failure.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
gpg.present does not ensure presence
turned out to be multiple problems:gpg.present
did not check the return value ofgpg.receive_keys
at all ([BUG] GPG state module always reports success without changes #63153)gpg.receive_keys
returned success even though the missing user ID prevented an importI repurposed this issue for the latter one.
The text was updated successfully, but these errors were encountered: