Merge lp://staging/~abentley/charms/precise/juju-reports/templates-and-ssh into lp://staging/~juju-qa/charms/precise/juju-reports/trunk

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 32
Proposed branch: lp://staging/~abentley/charms/precise/juju-reports/templates-and-ssh
Merge into: lp://staging/~juju-qa/charms/precise/juju-reports/trunk
Diff against target: 201 lines (+62/-72)
3 files modified
hooks/common.py (+54/-72)
hooks/install (+5/-0)
hooks/start (+3/-0)
To merge this branch: bzr merge lp://staging/~abentley/charms/precise/juju-reports/templates-and-ssh
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+222333@code.staging.launchpad.net

Commit message

Allow ini to be based on templates, allow ubuntu to use ssh.

Description of the change

This branch allows ubuntu to use ssh as lp-qa-bot, and to use templates from resources/ to create ini files.

Allowing SSH requires
- proper SSH configuration. Since bzr does not allow SSH options to be supplied at the commandline, I have written the same config to ~ubuntu/.ssh as ~root/.ssh.

- The SSH key. I extracted open_secret from update_source, and tweaked it to allow chmodding.

I also extracted configure_lp from update_source, because one does not depend on the other.

Using templates is basically simple. We open resources/production.ini.template, update it with the mongodb config values, and write it as production.ini. This overwrites any existing production.ini, but we're a charm and we expect to be the only one managing configuration.

In current jujureports trees, resources/production.ini.template does not exist. We handle this by falling back to production.ini as the "template".

In future jujureports trees, production.ini will not exist, it will be renamed to reports/production.ini.template. The start hook handles this by exiting early if production.ini does not exist.

Existing deploys are locally-modified-- production.ini has different contents and development.ini and test.ini are deleted. This branch undoes these modification by reverting all files in resources/

I optimized deploy speed by allowing update_source to run before the database settings are determined. This led to a refactoring of the config-checking code, where every step that can be run is run. So get_config and IncompleteConfig are no longer needed.

As a driveby, I eliminated in_juju_reports.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you

review: Approve (code)

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: