Skip to content

Improve error handling of peadm::download task #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2020

Conversation

Sharpie
Copy link
Member

@Sharpie Sharpie commented May 8, 2020

Prior to this commit, the peadm::download task would exit with
"success" when S3 returned a "404 Not Found" error page. This
would happen when a PE version was reqeusts that did not support
the OS platforms being provisioned. E.g. requesting an install of
PE 2018.1 on RedHat 8. The provisioning plan would then blow
later when tar found an XML document instead of a gzipped archive.

This commit updates the download task to:

  • Print the URL being downloaded to stderr.

  • Pass the -f flag to curl when downloading tarballs.
    This causes curl to exit with a status of 22 if the
    HTTP response is an error.

Prior to this commit, the `peadm::download` task would exit with
"success" when S3 returned a "404 Not Found" error page. This
would happen when a PE version was reqeusts that did not support
the OS platforms being provisioned. E.g. requesting an install of
PE 2018.1 on RedHat 8. The provisioning plan would then blow
later when `tar` found an XML document instead of a gzipped archive.

This commit updates the download task to:

  - Print the URL being downloaded to stderr.

  - Pass the `-f` flag to `curl` when downloading tarballs.
    This causes curl to exit with a status of 22 if the
    HTTP response is an error.
@Sharpie Sharpie requested a review from a team as a code owner May 8, 2020 21:15
@reidmv
Copy link
Contributor

reidmv commented May 8, 2020

👍 LGTM, thanks @Sharpie!

@reidmv reidmv merged commit 64d8715 into puppetlabs:master May 8, 2020
@Sharpie Sharpie deleted the improve-download-error-detection branch May 8, 2020 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants