Skip to content
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

jinja2.exceptions.TemplateNotFound: snippets/builder_vsphere_windows.json #71

Closed
mlinton opened this issue Aug 28, 2017 · 5 comments
Closed

Comments

@mlinton
Copy link

mlinton commented Aug 28, 2017

Attempting to install and use malboxes on OSX using vSphere backend.

I have modified the ~/Library/Application Support/malboxes/config.js with the vsphere info, and when I try to run malboxes build win10_64_analyst, it throws the following:

CoreBook:malboxes marklinton$ malboxes build win10_64_analyst
Generating configuration files...
Traceback (most recent call last):
  File "/usr/local/bin/malboxes", line 11, in <module>
    load_entry_point('malboxes==0.4.0.dev0', 'console_scripts', 'malboxes')()
  File "/usr/local/lib/python3.6/site-packages/malboxes/__init__.py", line 21, in main
    main()
  File "/usr/local/lib/python3.6/site-packages/malboxes/malboxes.py", line 570, in main
    args.func(parser, args)
  File "/usr/local/lib/python3.6/site-packages/malboxes/malboxes.py", line 390, in build
    config, packer_tmpl = prepare_config(args.template)
  File "/usr/local/lib/python3.6/site-packages/malboxes/malboxes.py", line 201, in prepare_config
    packer_tmpl = prepare_packer_template(config, template)
  File "/usr/local/lib/python3.6/site-packages/malboxes/malboxes.py", line 151, in prepare_packer_template
    f.write(template.render(config)) # pylint: disable=no-member
  File "/usr/local/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/site-packages/malboxes/templates/win10_64_analyst.json", line 9, in top-level template code
    {% include 'snippets/builder_vsphere_windows.json' %},
  File "/usr/local/lib/python3.6/site-packages/jinja2/loaders.py", line 187, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: snippets/builder_vsphere_windows.json

I think related to not being able to find the snippet. Any ideas?

@obilodeau
Copy link
Member

I just pushed a fix. Can you pip uninstall / pip install and try again please?

@obilodeau obilodeau reopened this Aug 28, 2017
@jthomp888999
Copy link

I'm having sort of a similar issue, not sure if it should be separated from this one. Just trying malboxes build <any_template> fails on a fresh install. I get:
File "/usr/lib/python3/dist-packages/jinja2/compiler.py", line 427, in fail raise TemplateAssertionError(msg, lineno, self.name, self.filename) jinja2.exceptions.TemplateAssertionError: no filter named 'tojson'

It looks like it's coming from here:
File "/usr/local/lib/python3.5/dist-packages/malboxes/templates/win7_32_analyst.json", line 39, in template ,{{ p | tojson }}
If I need to make a new bug I can, but I thought they might be related. Thanks.

@xambroz
Copy link

xambroz commented Sep 21, 2017

@jthomp888999 I believe that the issue with 'tojson' is some different issue. I have created bug report #80 for that - #80

@obilodeau
Copy link
Member

@jthomp888999, now that #82 is in master, can you give it another try?

@mlinton, do you still have an issue?

@jthomp888999
Copy link

It's all good with me now, thank you!

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

No branches or pull requests

4 participants