Merge lp:~abentley/charms/precise/juju-reports/gh-token into lp:~juju-qa/charms/precise/juju-reports/trunk

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 36
Proposed branch: lp:~abentley/charms/precise/juju-reports/gh-token
Merge into: lp:~juju-qa/charms/precise/juju-reports/trunk
Diff against target: 45 lines (+8/-3)
2 files modified
config.yaml (+4/-0)
hooks/common.py (+4/-3)
To merge this branch: bzr merge lp:~abentley/charms/precise/juju-reports/gh-token
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+226042@code.launchpad.net

Commit message

Support gh-token.

Description of the change

This branch adds a gh-token config variable which is inserted into production.ini, as used by lp:~abentley/juju-reports/git-commits.

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
1=== modified file 'config.yaml'
2--- config.yaml 2014-07-04 20:45:54 +0000
3+++ config.yaml 2014-07-08 20:57:15 +0000
4@@ -24,6 +24,10 @@
5 type: string
6 default: ""
7 description: "OAuth credentials for accessing private data on Launchapd."
8+ gh-token:
9+ type: string
10+ default: ""
11+ description: "GitHub OAuth token to use for counting revisions."
12 dist-clean:
13 type: boolean
14 default: true
15
16=== modified file 'hooks/common.py'
17--- hooks/common.py 2014-07-04 20:45:54 +0000
18+++ hooks/common.py 2014-07-08 20:57:15 +0000
19@@ -31,13 +31,14 @@
20 return config
21
22
23-def install_ini(mongo_url):
24+def install_ini(mongo_url, gh_token):
25 config = ConfigParser()
26 path = os.path.join(PROJECT_DIR, INI_TEMPLATE)
27 if not os.path.exists(path):
28 path = get_ini_path()
29 config.read(path)
30 config.set('app:main', 'mongo.url', mongo_url)
31+ config.set('app:main', 'gh_token', gh_token)
32 config.write(open(get_ini_path(), 'w'))
33 return config
34
35@@ -219,8 +220,8 @@
36 if mongo_url == '':
37 hookenv.log('No mongodb set up.')
38 return
39- ini = install_ini(mongo_url)
40- for key in ['lp-key', 'lp-oauth']:
41+ ini = install_ini(mongo_url, config['gh-token'])
42+ for key in ['lp-key', 'lp-oauth', 'gh-token']:
43 if config[key] == '':
44 hookenv.log('Not setting up cron because {} not set.'.format(key))
45 break

Subscribers

People subscribed via source and target branches

to all changes: