ansible / mazer

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

Handle 404 download errors in fetch() better #54

Closed alikins closed 6 years ago

alikins commented 6 years ago
SUMMARY

Based on error reported at https://github.com/ansible/galaxy-cli/pull/50#issuecomment-391658643

If the content_archive url we build up to fetch from archive source (ie, github.com/$user/$project/archive') results in a 404, handle the error better.

Extend GalaxyDownloadError to include the url of the request that failed. Add unit tests.

Make fetch.galaxy_url.GalaxyUrl set it's remote_resource properly for including in messages and errors.

Stop ignoring download exceptions in GalaxyUrl.fetch() and returning None so it makes it back to flat_rest_api.content.GalaxyContent.install

GalaxyContent.install handles the GalaxyDownloadError, logs the exception and re raise so it propagates to error handling in main.

ISSUE TYPE
GALAXY CLI VERSION
Ansible Galaxy CLI, version 0.1.0
Linux, newswoop, 4.16.6-202.fc27.x86_64, #1 SMP Wed May 2 00:09:32 UTC 2018, x86_64
3.6.5 (default, Apr  4 2018, 15:01:18) 
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] /home/adrian/venvs/galaxy-cli-py3/bin/python
No config file found; using defaults
ADDITIONAL INFORMATION