~adeuring/charms/precise/juju-reports/juju-reports-new-revno-in-new-dir

« back to all changes in this revision

Viewing changes to hooks/common.py

  • Committer: Aaron Bentley
  • Date: 2014-07-15 14:58:33 UTC
  • mfrom: (37.1.1 juju-ci-url-config)
  • Revision ID: aaron.bentley@canonical.com-20140715145833-e0n53up5ms44tqlr
SupportĀ settingĀ jujuci-url.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    return config
32
32
 
33
33
 
34
 
def install_ini(mongo_url, gh_token):
 
34
def install_ini(mongo_url, gh_token, jujuci_url):
35
35
    config = ConfigParser()
36
36
    path = os.path.join(PROJECT_DIR, INI_TEMPLATE)
37
37
    if not os.path.exists(path):
39
39
    config.read(path)
40
40
    config.set('app:main', 'mongo.url', mongo_url)
41
41
    config.set('app:main', 'gh_token', gh_token)
 
42
    config.set('app:main', 'jujuci.url', jujuci_url)
42
43
    config.write(open(get_ini_path(), 'w'))
43
44
    return config
44
45
 
221
222
    if mongo_url == '':
222
223
        hookenv.log('No mongodb set up.')
223
224
        return
224
 
    ini = install_ini(mongo_url, config['gh-token'])
 
225
    ini = install_ini(mongo_url, config['gh-token'], config['jujuci-url'])
225
226
    for key in ['lp-key', 'lp-oauth', 'gh-token']:
226
227
        if config[key] == '':
227
228
            hookenv.log('Not setting up cron because {} not set.'.format(key))