From 747deecaf684cab1ca945b7b5305b9399cad37ae Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Mon, 15 Aug 2011 09:36:06 -0700 Subject: [PATCH] Add assert to catch simple typos in roles list. Input of "roles:\n- [mds,1]" used to make teuthology crash in a non-obviou way. --- teuthology/task/internal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index 0aa77c8d6e..5829d59d1b 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -118,6 +118,8 @@ def connect(ctx, config): ctx.cluster = orchestra.cluster.Cluster() if 'roles' in ctx.config: for rem, roles in zip(remotes, ctx.config['roles']): + assert all(isinstance(role, str) for role in roles), \ + "Roles in config must be strings: %r" % roles ctx.cluster.add(rem, roles) else: for rem in remotes: -- 2.39.5