saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.19k stars 5.48k forks source link

salt-key fails but exits with 0 (redux) #54190

Open brianthelion opened 5 years ago

brianthelion commented 5 years ago

Description of Issue

Identical to #18562 and #42468. According to those reports, this is a duplicate of #18510 and should have been corrected in Flourine. That does not appear to be the case.

Setup

curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
sudo sh bootstrap-salt.sh -M
sudo salt-key -a some_nonexistent_key -y
echo $?

Steps to Reproduce Issue

INCORRECT: The above echoes "0" CORRECT: The above echoes something other than "0"

Versions Report

           Salt: 2019.2.0

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.3
      gitpython: 2.1.8
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.6.8 (default, Jan 14 2019, 11:02:34)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.3
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5

System Versions:
           dist: Ubuntu 18.04 bionic
         locale: UTF-8
        machine: x86_64
        release: 4.15.0-55-generic
         system: Linux
        version: Ubuntu 18.04 bionic
dmurphy18 commented 5 years ago

@brianthelion Thanks for the heads up, the PR https://github.com/saltstack/salt/pull/48361 sorted out salt/salt-call error messaging but in the work it appears that salt-key was overlooked. With a simple master and minion on the same host.

root@david-VirtualBox:~# salt-key -a doesnot_exist key The key glob 'doesnot_exist' does not match any unaccepted keys. root@david-VirtualBox:~# echo $? 0 root@david-VirtualBox:~#

Shows that clearly an error code should have been set.