voxpupuli / puppet-staging

⛔️ Deprecated in favor of puppet-archive
https://forge.puppet.com/puppet/archive
Apache License 2.0
51 stars 109 forks source link

some download error handling... #37

Closed wbean1 closed 10 years ago

wbean1 commented 10 years ago

A couple thoughts on some download error handling that could potentially be added to this module...

  1. in file.pp, remove file when wget/curl exit with non-zero? $http_get = "curl ... || rm -f ${name}"
  2. use exec's tries attribute, in conjunction with curl's -C - and wget's --continue to resume broken transfers?

we've implemented item 1 since even a failed download will create the file and result in the file not being redownloaded.

I could submit a pull request for either route if interested.

nanliu commented 10 years ago

I do not plan to add any new functionality, but I'm happy to merge a pull request with this capability.

Due to the complexity of trying to do all this as an exec, most of this module functionality have been reimplemented in https://github.com/nanliu/puppet-archive via type/provider. The new module will delete the downloaded file if the http status code is not in the 200 range, and can perform checksums post download. I think that will be the better route.