Merge lp://qastaging/~lazypower/charm-tools/chef_template into lp://qastaging/charm-tools/1.4

Proposed by Charles Butler
Status: Needs review
Proposed branch: lp://qastaging/~lazypower/charm-tools/chef_template
Merge into: lp://qastaging/charm-tools/1.4
Diff against target: 979 lines (+828/-0)
22 files modified
charmtools/templates/chef/__init__.py (+18/-0)
charmtools/templates/chef/files/README.ex (+44/-0)
charmtools/templates/chef/files/config.yaml (+14/-0)
charmtools/templates/chef/files/hooks/Gemfile (+4/-0)
charmtools/templates/chef/files/hooks/Gemfile.lock (+64/-0)
charmtools/templates/chef/files/hooks/bootstrap (+20/-0)
charmtools/templates/chef/files/hooks/cookbooks/charm-name/metadata.rb (+8/-0)
charmtools/templates/chef/files/hooks/cookbooks/juju-helpers/definitions/juju_port.rb (+11/-0)
charmtools/templates/chef/files/hooks/cookbooks/juju-helpers/definitions/relation_set.rb (+10/-0)
charmtools/templates/chef/files/hooks/cookbooks/juju-helpers/libraries/juju.rb (+28/-0)
charmtools/templates/chef/files/hooks/cookbooks/juju-helpers/libraries/juju/juju_helpers.rb (+48/-0)
charmtools/templates/chef/files/hooks/cookbooks/juju-helpers/libraries/juju/juju_helpers_dev.rb (+25/-0)
charmtools/templates/chef/files/hooks/cookbooks/juju-helpers/metadata.rb (+7/-0)
charmtools/templates/chef/files/hooks/cookbooks/relation-name-relation/metadata.rb (+8/-0)
charmtools/templates/chef/files/hooks/install (+5/-0)
charmtools/templates/chef/files/hooks/stub (+15/-0)
charmtools/templates/chef/files/icon.svg (+279/-0)
charmtools/templates/chef/files/metadata.yaml (+17/-0)
charmtools/templates/chef/template.py (+87/-0)
setup.py (+1/-0)
tests_functional/create/test.sh (+4/-0)
tests_functional/create/test_chef_create.py (+111/-0)
To merge this branch: bzr merge lp://qastaging/~lazypower/charm-tools/chef_template
Reviewer Review Type Date Requested Status
Tim Van Steenburgh (community) Needs Fixing
charmers Pending
Review via email: mp+236779@code.qastaging.launchpad.net

Description of the change

Preliminary chef charm template generator.

This is my first template submission, please be critical.

To post a comment you must log in.
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

Just scanned the diff, here's a few things I noticed:

* Don't forget to add an entry point for the chef template in setup.py
* Don't forget to add unit and/or functional tests for the chef template. Can probably just copy/paste tests for other templates and tweak slightly.
* Consider whether you might want to bake some charm tests into the template. Not necessary, but Cory did that on the python template and I thought it was a great idea.

346. By Charles Butler

Remove unused dependency on pkg_resources from test

Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

Tests look good! I a have couple more observations:

1. The install hook fails when I deploy the freshly-created charm, although the cause wasn't immediately obvious:

(1.4)1 tvansteenburgh@trusty-vm:/tmp/precise/chef> sudo !!
sudo tail ~/.juju/local/log/unit-chef-0.log
2014-10-03 13:52:52 INFO unit.chef/0.install context.go:473 [2014-10-03T09:52:52-04:00] INFO: Run List is [recipe[charm-name::install]]
2014-10-03 13:52:52 INFO unit.chef/0.install context.go:473 [2014-10-03T09:52:52-04:00] INFO: Run List expands to [charm-name::install]
2014-10-03 13:52:52 INFO unit.chef/0.install context.go:473 [2014-10-03T09:52:52-04:00] INFO: Starting Chef Run for tvansteenburgh-local-machine-1
2014-10-03 13:52:52 INFO unit.chef/0.install context.go:473 [2014-10-03T09:52:52-04:00] INFO: Running start handlers
2014-10-03 13:52:52 INFO unit.chef/0.install context.go:473 [2014-10-03T09:52:52-04:00] INFO: Start handlers complete.
2014-10-03 13:52:52 INFO unit.chef/0.install context.go:473 [2014-10-03T09:52:52-04:00] ERROR: Running exception handlers
2014-10-03 13:52:52 INFO unit.chef/0.install context.go:473 [2014-10-03T09:52:52-04:00] ERROR: Exception handlers complete
2014-10-03 13:52:52 INFO unit.chef/0.install context.go:473 [2014-10-03T09:52:52-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
2014-10-03 13:52:52 INFO unit.chef/0.install context.go:473 [2014-10-03T09:52:52-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
2014-10-03 13:52:52 ERROR juju.worker.uniter uniter.go:566 hook failed: exit status 1
(1.4)tvansteenburgh@trusty-vm:/tmp/precise/chef> sudo tail /var/chef/cache/chef-stacktrace.out
tail: cannot open ‘/var/chef/cache/chef-stacktrace.out’ for reading: No such file or directory

2. It would be best if you could eliminate the symlinks in the charm. We kind of outlawed those recently since they don't work on Windows.

review: Needs Fixing

Unmerged revisions

346. By Charles Butler

Remove unused dependency on pkg_resources from test

345. By Charles Butler

Wrap up of chef template creation and tests

344. By Charles Butler

Corrects the list duplication in the integration test

343. By Charles Butler

Preliminary tests that are failing due to duplication in epxected list

342. By Charles Butler

Wipes unused revision file, validated charm integrity, added endpoint to create with a chef template

341. By Charles Butler

Updated owner statements, and added missing relationship symlinks

340. By Charles Butler

Adds chef charm template

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: