Git Product home page Git Product logo

python-packer's People

Contributors

andyjp94 avatar nir0s avatar sijis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

python-packer's Issues

Still there?

I’m considering replicating my bash build scripts in Python. This would be useful. Happy to contribute, but I’d roll my own if you aren’t going to maintain...

vars-file error

After a clean pip install of python-packer (which is pretty neat by the by), I noticed that validating json would fail when using a var-file. Packer is actually looking for -var-file, rather than -vars-file.

[GCC 4.9.2 20150212 (Red Hat 4.9.2-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Python shell history and tab completion are enabled.

import packer
packerfile = '/home/prata/code/packer/templates/webserver.json'
exc = []
vars_file = '/home/prata/code/packer/environment/kuei-jin.json'
packer_exec_path = '/opt/packer/packer'
p = packer.Pack(packerfile, exc=exc, vars_file=vars_file, exec_path=packer_exec_path)
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'Pack'
p = packer.Packer(packerfile, exc=exc, vars_file=vars_file, exec_path=packer_exec_path)
p.validate(syntax_only=False)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/packer/init.py", line 124, in validate
return command()
File "/usr/lib/python2.7/site-packages/sh.py", line 1021, in call
return RunningCommand(cmd, call_args, stdin, stdout, stderr)
File "/usr/lib/python2.7/site-packages/sh.py", line 486, in init
self.wait()
File "/usr/lib/python2.7/site-packages/sh.py", line 500, in wait
self.handle_command_exit_code(exit_code)
File "/usr/lib/python2.7/site-packages/sh.py", line 516, in handle_command_exit_code
raise exc(self.ran, self.process.stdout, self.process.stderr)
sh.ErrorReturnCode_1:

RAN: '/opt/packer/packer validate -vars-file=/home/prata/code/packer/environment/kuei-jin.json /home/prata/code/packer/templates/webserver.json'

Options:

-syntax-only Only check syntax. Do not verify config of the template.
-except=foo,bar,baz Validate all builds other than these
-only=foo,bar,baz Validate only these builds
-var 'key=value' Variable for templates, can be used multiple times.
-var-file=path JSON file containing user variables.

I removed the Usage info and just copied the Options section from the error. Below is my version of packer being used.

[prata@kusanagi packer]$ /opt/packer/packer version
Packer v0.7.5

Your version of Packer is out of date! The latest version
is 0.8.2. You can update by downloading from www.packer.io
[prata@kusanagi packer]$

Would you like me to submit a pull request for this? It's a pretty simple change. Thanks!

Remove installer

I think the installer class should be removed. It is too intrusive to have it there.

Anyone disagrees?

no output to stdout

When I run a packer build of an AMI using this module, the command starts and runs......... and runs........ then just spits back my prompt. Is it done? Did it build? No clue... 😢

I've tried both Debug set to True & False p.build(parallel=True, debug=False, force=False) & p.build(parallel=True, debug=True, force=False)

I would like to have it output the same stdout that the native Packer outputs.

Open for contributions?

Hi, this hasn't been alive for a while, but wondering if you would be open for new maintainers. It would be great to merge the current pull requests, add typing and a few other things. Thanks!

Remove `sh` dependency

Currently, there's only one dependency for packer - sh. I don't see a reason to keep that dependency as it can be easily replaced with subprocess.

Support --on-error

It would be great if the "-on-error=[cleanup|abort|ask]" was supported.

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.