ansible / mazer

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

mazer gives unclear error message if pointing to invalid release #289

Open rambleraptor opened 5 years ago

rambleraptor commented 5 years ago

Bug Report

MAZER VERSION
name = mazer
version = 1.0.0
config_file = /Users/alexstephen/.ansible/mazer.yml
uname = Darwin, xxx, 18.6.0, Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64, x86_64
executable_location = /Users/alexstephen/.pyenv/versions/2.7.8/bin/mazer
python_version = 2.7.8 (default, Jun 26 2019, 11:22:17) [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)]
python_executable = /Users/alexstephen/.pyenv/versions/2.7.8/bin/python2.7
CONFIGURATION
SUMMARY

If I run mazer publish releases/wrong_file.tar.gz, mazer will say that I have to specify a path to a collection archive instead of saying that I put in an invalid command. This confuses the user, as it makes them think that they didn't use the proper flags / syntax.

This is a really common thing to happen if you're changing namespaces (which changes the release filename).

STEPS TO REPRODUCE
mazer publish releases/wrong_file.tar.gz
EXPECTED RESULTS

An error message pointing out that the file does not exist.

ACTUAL RESULTS
Traceback (most recent call last):
  File "/Users/alexstephen/.pyenv/versions/2.7.8/bin/mazer", line 10, in <module>
    sys.exit(main())
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy_cli/main.py", line 36, in main
    exit_code = cli.run()
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy_cli/cli/galaxy.py", line 240, in run
    return self.execute()
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy_cli/cli/__init__.py", line 152, in execute
    return fn()
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy_cli/cli/galaxy.py", line 319, in execute_publish
    raise cli_exceptions.CliOptionsError("- you must specify a path to a collection archive")
ansible_galaxy_cli.exceptions.CliOptionsError: - you must specify a path to a collection archive