macadmins / installapplications

A tool for dynamically using installapplication
Apache License 2.0
285 stars 62 forks source link

Move main loop into function. #94

Closed thehilll closed 3 years ago

thehilll commented 3 years ago

This moves the main loop that processes all of the --item arguments and creates the stages dictionary out into a separate function.

The point of this is to allow accessing this code from a process outside of generatejson.py that might be more complex. We have an external process that uploads all of the files (and bootstrap.json) to a host as well as generates signed URLs. In the past we have called generatejson.py via subprocess, but that seems like a bit of a hack.

Rather than re-implement all of the code you use to generate the important dictionary and file hashes in our script, it seemed like we might suggest this modification that would allow external tools to get access to the dictionary that generatejson.py constructs easily.

Changes are:

Thanks for considering this.

erikng commented 3 years ago

sorry for just seeing this. I just merged something that conflicts here. Can you take a look?

thehilll commented 3 years ago

Sorry this took so long, I was away.

I've updated generatejson.py to be based off your new version. I've looked, but I can't figure out the proper way to update my fork's branch so that this doesn't show conflicts. If you like I could just close this and create a new pull request pulled from your current version.

Thanks.

erikng commented 3 years ago

Yeah let's do that.

thehilll commented 3 years ago

Ok, I've done that and will close this one. Thanks again.