Merge lp:~jcsackett/charms/precise/charmworld/set-lp-credentials into lp:~juju-jitsu/charms/precise/charmworld/trunk

Proposed by j.c.sackett
Status: Merged
Merged at revision: 82
Proposed branch: lp:~jcsackett/charms/precise/charmworld/set-lp-credentials
Merge into: lp:~juju-jitsu/charms/precise/charmworld/trunk
Prerequisite: lp:~jcsackett/charms/precise/charmworld/cloud-tools-apt-fix
Diff against target: 41 lines (+12/-0)
3 files modified
config.yaml (+5/-0)
hooks/config-changed (+6/-0)
production_overrides.ini (+1/-0)
To merge this branch: bzr merge lp:~jcsackett/charms/precise/charmworld/set-lp-credentials
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+192073@code.launchpad.net

Commit message

Updates the charm to set the lp_credentials as a config option.

Description of the change

The new review job requires an authenticated login to LP via launchpadlib. This
updates the charm to put the right user's (Charmbot) credentials into the
charmworld unit.

config.yaml && hooks/config-changed
-----------------------------------
lp_credentials is added as a new option in config.yaml. hooks/config-changed
writes this out after the configure step. The location of the credentials file
is hardcoded to the webops_deploy/charmworld path.

production_overrides.ini
------------------------
The hardcoded path is added to the overrides. This is hardcoded b/c we're
already engaged in some magic to generate our .ini's--we want to minimize doing
this any further.

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2013-09-20 12:39:25 +0000
3+++ config.yaml 2013-10-22 00:33:37 +0000
4@@ -47,3 +47,8 @@
5 The number of replicas used by ElasticSearch for indices.
6 This number should not exceed the number of ElasticSearch nodes
7 minus one.
8+ lp_credentials:
9+ type: string
10+ default: ''
11+ description: |
12+ The lp credentials to use with charmworld ingest, if available.
13
14=== modified file 'hooks/config-changed'
15--- hooks/config-changed 2013-07-08 19:45:50 +0000
16+++ hooks/config-changed 2013-10-22 00:33:37 +0000
17@@ -88,6 +88,12 @@
18 update_source
19 fi
20 configure
21+
22+lp_credentials=`config-get lp_credentials`
23+if [ -n "$lp_credentials" ]; then
24+ config-get lp_credentials > /home/webops_deploy/charmworld/charmbot_credentials.txt
25+fi
26+
27 chown webops_deploy.webops_deploy $project_dir -R
28 can_ingest=$(is_configured_to_ingest)
29
30
31=== modified file 'production_overrides.ini'
32--- production_overrides.ini 2013-05-02 18:40:07 +0000
33+++ production_overrides.ini 2013-10-22 00:33:37 +0000
34@@ -5,6 +5,7 @@
35 mongo.host =
36 mongo.port =
37 mongo.url =
38+lp_credentials_file = "/home/webops_deploy/charmworld/charmbot_credentials.txt"
39
40 [server:main]
41 port = 6543

Subscribers

People subscribed via source and target branches

to all changes: