New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 80193


Ignore:
Timestamp:
07/06/11 08:59:55 (4 years ago)
Author:
wsiegrist@…
Message:

Tweak json file logic so non-production does not need any files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contrib/buildbot/master.cfg

    r80192 r80193  
    44import json 
    55import os 
     6 
     7 
     8def _path(name): 
     9    return os.path.join(os.path.dirname(__file__), name) 
    610 
    711# This is a buildmaster config file. It must be installed as 
     
    1721 
    1822production = False 
    19 with open(os.path.join(os.path.dirname(__file__), 'config.json')) as f: 
    20     production = json.load(f)['production'] 
     23if os.path.exists(_path('config.json')): 
     24    with open(_path('config.json')) as f: 
     25        production = json.load(f)['production'] 
    2126 
    2227####### BUILDSLAVES 
     
    3035if production: 
    3136    slavedata = {} 
    32     with open(os.path.join(os.path.dirname(__file__), 'slaves.json')) as f: 
     37    with open(_path('slaves.json')) as f: 
    3338        slavedata = json.load(f) 
    3439    for slave, pwd in slavedata.items(): 
     
    5459    from buildbot.changes.pb import PBChangeSource 
    5560    sourcedata = [] 
    56     with open(os.path.join(os.path.dirname(__file__), 'source.json')) as f: 
     61    with open(_path('source.json')) as f: 
    5762        sourcedata = json.load(f) 
    5863    c['change_source'] = PBChangeSource(user=sourcedata[0], passwd=sourcedata[1]) 
Note: See TracChangeset for help on using the changeset viewer.