~patrick-hetu/charms/precise/buildbot-master/charmhelpers

« back to all changes in this revision

Viewing changes to hooks/config-changed

  • Committer: Francesco Banconi
  • Date: 2012-02-14 12:00:43 UTC
  • mfrom: (30.1.2 02-14)
  • Revision ID: francesco.banconi@canonical.com-20120214120043-ln8ct4tylblu759v
[r=gmb] Slaves JSON initialization problem.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    buildbot_reconfig,
29
29
    config_json,
30
30
    generate_string,
 
31
    slave_json,
31
32
    )
32
33
 
33
34
REQUIRED_KEYS = [
146
147
    uid, gid = get_user_ids('buildbot')
147
148
    os.chown(master_cfg_path, uid, gid)
148
149
    with su('buildbot'):
 
150
        # Initialise the slave JSON if it doesn't exist.
 
151
        if not slave_json.exists():
 
152
            slave_json.set({})
149
153
        placeholder_path = os.path.join(buildbot_dir, 'placeholder.json')
150
154
        if not os.path.exists(placeholder_path):
151
155
            with open(placeholder_path, 'w') as f: