Skip to content

[BUG] GPG state module does not respect test mode #63156

Closed
@lkubb

Description

Description
gpg.present and gpg.absent make changes, even in test mode [although they do not report changes, even in non-test mode].

Setup
irrelevant

Steps to Reproduce the behavior

$ mkdir -p /tmp/gnupg
$ salt-call gpg.list_keys gnupghome=/tmp/gnupg
local:
$ salt-call state.single gpg.present D75899B9A724937A gnupghome=/tmp/gnupg test=true
local:
----------
          ID: D75899B9A724937A
    Function: gpg.present
      Result: True
     Comment: Adding D75899B9A724937A to GPG keychain
     Started: 18:24:06.971260
    Duration: 7763.386 ms
     Changes:

Summary for local
------------
Succeeded: 1
Failed:    0
------------
Total states run:     1
Total run time:   7.763 s
$ salt-call gpg.list_keys gnupghome=/tmp/gnupg
local:
    |_
      ----------
      created:
          2016-06-14
      fingerprint:
          28806A878AE423A28372792ED75899B9A724937A
      keyLength:
          4096
      keyid:
          D75899B9A724937A
      ownerTrust:
          Unknown
      trust:
          Unknown
      uids:
          - Nextcloud Security <security@nextcloud.com>

Expected behavior
No changes

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3005.1

Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: 4.0.9
     gitpython: 3.1.29
        Jinja2: 3.1.0
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
        Python: 3.9.14 (main, Sep 27 2022, 00:00:00)
  python-gnupg: 0.4.8
        PyYAML: 5.4.1
         PyZMQ: 23.2.0
         smmap: 5.0.0
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: rocky 9.0 Blue Onyx
        locale: utf-8
       machine: x86_64
       release: 5.14.0-70.26.1.el9_0.x86_64
        system: Linux
       version: Rocky Linux 9.0 Blue Onyx

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions