Skip to content
This repository has been archived by the owner on Feb 17, 2018. It is now read-only.

Commit

Permalink
more robust slave description
Browse files Browse the repository at this point in the history
also enforce slave name
  • Loading branch information
sigma committed Mar 23, 2012
1 parent f0b646d commit 7eeaf69
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions emacs/slaves.py
Expand Up @@ -10,16 +10,18 @@ def getSlaves():
slaves = []

for s in os.listdir(_slaves_defs_dir):
f = file(os.path.join(_slaves_defs_dir, s, 'slave.yaml'), 'r')
d = yaml.load(f)
if not d.has_key('name') or not d.has_key('password'):
continue
fpath = os.path.join(_slaves_defs_dir, s, 'slave.yaml')
if os.path.exists(fpath):
f = file(fpath, 'r')
d = yaml.load(f)
if not d.has_key('password'):
continue

properties = {}
if d.has_key('features'):
properties['features'] = d['features']
properties = {}
if d.has_key('features'):
properties['features'] = d['features']

slaves.append(BuildSlave(d['name'], d['password'],
properties=properties))
slaves.append(BuildSlave(s, d['password'],
properties=properties))

return slaves

0 comments on commit 7eeaf69

Please sign in to comment.