Giter Club home page Giter Club logo

Comments (5)

nanliu avatar nanliu commented on June 24, 2024

Interesting bug based on your use case. I can't always assume the same filename is the same file, but I'm trying to understand if it makes sense to download the same file twice. Would it be more effective to download one archive and use the file resource to place it in multiple location (unless you need extraction). I'll give it some thought.

Your PR is currently failing spec test, so can not be merged.

from puppet-archive.

JoshiiSinfield avatar JoshiiSinfield commented on June 24, 2024

it doesn't make sense to download the same file twice, you're quite right. I am currently downloading one file to /tmp and using the file resource to place it in multiple locations yes.

originally I was using archive to download it multiple times - putting a jar file into specific webapps//WEB-INF/lib/ on tomcat - which depends on the dirs being created already - by tomcat exploding the war. And then i switched to using the one archive download, and file resources to place it in the correct locations, however I was getting issues with directories not pre-existing. Which I then thought "oh, archive must do a mkdir_p or something similar as it was working previously with the multiple archives downloading straight to the WEB-INF/lib folder" however it seems I'm wrong, and have issues with my resource orderings, timings etc.

This still seems to be a bug, even though how I came about it is not my actual use case anymore!

Thinking about your comments, I think it'd be wise to create a temp filename off a UUID? that way you will always know the temp file created there and then has a unique name?

from puppet-archive.

nanliu avatar nanliu commented on June 24, 2024

Yep, agree definitely a bug.

from puppet-archive.

nanliu avatar nanliu commented on June 24, 2024

So giving it more thought, the fix for this issues is to change the full filepath :path to namevar, but that's going to be a major breaking change, because path was intended to be the file directory not the full file path. To preserve the existing module behavior

  1. namevar does not get transformed to filename.
  2. munging of namevar extracts path and filename.
  3. use some form of uuid for tempfile (maybe cache by checksum & checksum_type)

I think this will preserve backwards compatibility, but I really wish I didn't have to deprecate and move to a different resource parameter that's somewhat inconsistent with Puppet file.

from puppet-archive.

nanliu avatar nanliu commented on June 24, 2024

After reviewing :path is actually full path for file, so this was not as big a change as originally expected.

This is fixed in #47. I believe it's backwards compatible (the archive namevar change, not the archive class changes). Please verify and review the 0.3.x branch.

from puppet-archive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.