diff --git a/emacs/slaves.py b/emacs/slaves.py index f368c10..3949544 100644 --- a/emacs/slaves.py +++ b/emacs/slaves.py @@ -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