ansible / mazer

Experimental Ansible Galaxy Content Manager
GNU General Public License v3.0
113 stars 18 forks source link

Failed installations are erroneously reported as successful #281

Open ironfroggy opened 5 years ago

ironfroggy commented 5 years ago

Bug Report

MAZER VERSION
name = mazer
version = 1.0.0
config_file = /home/calvin/.ansible/mazer.yml
uname = Linux, willow-epsilon, 4.4.0-17134-Microsoft, #706-Microsoft Mon Apr 01 18:13:00 PST 2019, x86_64
executable_location = /mnt/c/Users/calvin/redhat/.virtualenvs/orion/bin/mazer
python_version = 3.7.1 (default, Oct 22 2018, 11:21:55) [GCC 8.2.0]
python_executable = /mnt/c/Users/calvin/redhat/.virtualenvs/orion/bin/python3.7
CONFIGURATION

DEFAULTS

SUMMARY

Failed installations, due to pre-existing installs of a different version, do not report the failure either in the output or process return code.

STEPS TO REPRODUCE
$ mazer install --server=http://127.0.0.1:8000 orionuser1.collection_dep_a_lroadrrn,1.0.0
$ mazer install --server=http://127.0.0.1:8000 orionuser1.collection_dep_a_lroadrrn,2.0.0
EXPECTED RESULTS

If a user installs the current version of a collection again, I expect a notice that it is already installed, but not reported as either a warning or error, as the final state is successful and this mirrors other package utilities.

If a user tries to install a different version, without any other flags, and the installation refuses to install the newly requested version replacing the previous installation, I would expect to see an ERROR, not a WARNING, because the request is ultimately not satisfied. (Warnings should be reserved for requests that are completed, but which may in other cases fail, such as deprecation warnings). I also expect the process to result in a non-zero return code to indicate the error to scripts that might be invoking mazer install.

ACTUAL RESULTS
$ mazer install --server=http://127.0.0.1:8000 orionuser1.collection_dep_a_lroadrrn,2.0.0

Collection specs to install:
  orionuser1.collection_dep_a_lroadrrn,==2.0.0

Installing spec: orionuser1.collection_dep_a_lroadrrn,==2.0.0
  Found: orionuser1.collection_dep_a_lroadrrn,2.0.0 (for spec orionuser1.collection_dep_a_lroadrrn,==2.0.0)
WARNING|   orionuser1.collection_dep_a_lroadrrn,1.0.0 is already installed at /home/calvin/.ansible/collections/ansible_collections/orionuser1/collection_dep_a_lroadrrn
(orion) calvin:/mnt/c/Users/calvin/redhat/orion
$ echo $?
0