ansible / mazer

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

Improve `install` message formatting (rel to #255) #261

Closed alikins closed 5 years ago

alikins commented 5 years ago
SUMMARY

Related to #255, the output shown by 'install' subcommand obscure what was going on. Mostly by not including version info in places where the output references particular versions.

In general, the install output is hard to read.

For an example based on #255:

Before

(mazer040test) [newswoop:F29:collection_inspect (master % u=)]$ rm -rf /tmp/coltest2/* && mazer install --collections-path=/tmp/coltest2 --server http://galaxy-qa.ansible.com orionuser1.collection_dep_a_bvsivsmc
Installing orionuser1.collection_dep_a_bvsivsmc (version_spec: *)
- The repository orionuser1.collection_dep_a_bvsivsmc was successfully installed to /tmp/coltest2
Installing requirement orionuser1.collection_dep_a_dpvsiwdd (version_spec: ==1.0.0) (required by orionuser1.collection_dep_a_bvsivsmc)
Installing requirement orionuser1.collection_dep_a_kmcnjmib (version_spec: ==1.0.0) (required by orionuser1.collection_dep_a_bvsivsmc)
- The repository orionuser1.collection_dep_a_dpvsiwdd was successfully installed to /tmp/coltest2
- The repository orionuser1.collection_dep_a_kmcnjmib was successfully installed to /tmp/coltest2
Installing requirement orionuser1.collection_dep_a_vstghmmb (version_spec: ==2.0.0) (required by orionuser1.collection_dep_a_dpvsiwdd)
Installing requirement orionuser1.collection_dep_a_vstghmmb (version_spec: ==1.0.0) (required by orionuser1.collection_dep_a_kmcnjmib)
- The repository orionuser1.collection_dep_a_vstghmmb was successfully installed to /tmp/coltest2
WARNING| - orionuser1.collection_dep_a_vstghmmb was NOT installed successfully: The Galaxy content /tmp/coltest2/ansible_collections/orionuser1/collection_dep_a_vstghmmb/README.md appears to already exist. 
The Galaxy content /tmp/coltest2/ansible_collections/orionuser1/collection_dep_a_vstghmmb/README.md appears to already exist.:
- you can use --ignore-errors to skip failed collections and finish processing the list.

After

(mazer040test) [newswoop:F29:collection_inspect (master % u=)]$ rm -rf /tmp/coltest2/* && mazer install --collections-path=/tmp/coltest2 --server http://galaxy-qa.ansible.com orionuser1.collection_dep_a_bvsivsmc
Installing:
  orionuser1.collection_dep_a_bvsivsmc (version_spec: *)
Installed:
  orionuser1.collection_dep_a_bvsivsmc,1.0.0 to /tmp/coltest2/ansible_collections/orionuser1/collection_dep_a_bvsivsmc
Installing:
  orionuser1.collection_dep_a_dpvsiwdd (version_spec: ==1.0.0) (required by orionuser1.collection_dep_a_bvsivsmc,1.0.0)
  orionuser1.collection_dep_a_kmcnjmib (version_spec: ==1.0.0) (required by orionuser1.collection_dep_a_bvsivsmc,1.0.0)
Installed:
  orionuser1.collection_dep_a_dpvsiwdd,1.0.0 to /tmp/coltest2/ansible_collections/orionuser1/collection_dep_a_dpvsiwdd
  orionuser1.collection_dep_a_kmcnjmib,1.0.0 to /tmp/coltest2/ansible_collections/orionuser1/collection_dep_a_kmcnjmib
Installing:
  orionuser1.collection_dep_a_vstghmmb (version_spec: ==2.0.0) (required by orionuser1.collection_dep_a_dpvsiwdd,1.0.0)
  orionuser1.collection_dep_a_vstghmmb (version_spec: ==1.0.0) (required by orionuser1.collection_dep_a_kmcnjmib,1.0.0)
WARNING| - orionuser1.collection_dep_a_vstghmmb,1.0.0 was NOT installed successfully: The Galaxy content /tmp/coltest2/ansible_collections/orionuser1/collection_dep_a_vstghmmb/README.md appears to already exist. 
The Galaxy content /tmp/coltest2/ansible_collections/orionuser1/collection_dep_a_vstghmmb/README.md appears to already exist.:
- you can use --ignore-errors to skip failed collections and finish processing the list.

And for an example without errors:

Before

(mazer040test) [newswoop:F29:collection_inspect (master % u=)]$ rm -rf /tmp/coltest2/* && mazer install --collections-path=/tmp/coltest2 --server http://galaxy-qa.ansible.com alikins.collection_reqs_test
Installing alikins.collection_reqs_test (version_spec: *)
- The repository alikins.collection_reqs_test was successfully installed to /tmp/coltest2
Installing requirement alikins.collection_inspect (version_spec: *) (required by alikins.collection_reqs_test)
Installing requirement alikins.collection_ntp (version_spec: >=0.1.6) (required by alikins.collection_reqs_test)
- The repository alikins.collection_inspect was successfully installed to /tmp/coltest2
- The repository alikins.collection_ntp was successfully installed to /tmp/coltest2

After

(mazer040test) [newswoop:F29:collection_inspect (master % u=)]$ rm -rf /tmp/coltest2/* && mazer install --collections-path=/tmp/coltest2 --server http://galaxy-qa.ansible.com alikins.collection_reqs_test
Installing:
  alikins.collection_reqs_test (version_spec: *)
Installed:
  alikins.collection_reqs_test,2.1113.57 to /tmp/coltest2/ansible_collections/alikins/collection_reqs_test
Installing:
  alikins.collection_inspect (version_spec: *) (required by alikins.collection_reqs_test,2.1113.57)
  alikins.collection_ntp (version_spec: >=0.1.6) (required by alikins.collection_reqs_test,2.1113.57)
Installed:
  alikins.collection_inspect,0.0.42 to /tmp/coltest2/ansible_collections/alikins/collection_inspect
  alikins.collection_ntp,0.1.181 to /tmp/coltest2/ansible_collections/alikins/collection_ntp
ISSUE TYPE
MAZER VERSION
name = mazer
version = 0.5.0
config_file = /home/adrian/.ansible/mazer.yml
uname = Linux, newswoop, 5.0.5-200.fc29.x86_64, #1 SMP Wed Mar 27 20:58:04 UTC 2019, x86_64
executable_location = /home/adrian/venvs/mazer040test/bin/mazer
python_version = 3.6.8 (default, Jan 27 2019, 09:00:23) [GCC 8.2.1 20181215 (Red Hat 8.2.1-6)]
python_executable = /home/adrian/venvs/mazer040test/bin/python
ADDITIONAL INFORMATION
alikins commented 5 years ago

ping @ironfroggy

ironfroggy commented 5 years ago

I tested this out, I get the same non-traceback behavior now. That's definitely an improvement. It also fails now in the same way as the variation I mentioned: conflicts that don't exist at the same point, which already failed with this warning and not with a traceback like the original case.

Would it make sense to change that existing message this triggers from a "WARNING" to an "ERROR"? It causes an error return code from the process already, and does constitute an error in actually completing the installation.