Skip to content

Commit 9670490

Browse files
qa/tasks: add error condition to exec functions
Looking at the code that expands `all-roles` and `all-hosts` there's no proper error checking for when these values appear but there are >1 top-level roles in the task config. If a user does this it'll fail but in a somewhat unclear manner. Add a new condition that raises a clear exception in this case hopefully saving someone future debugging time. Signed-off-by: John Mulligan <[email protected]>
1 parent bf1607a commit 9670490

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

qa/tasks/cephadm.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,10 @@ def _expand_roles(ctx, config):
14291429
a = config['all-hosts']
14301430
roles = teuthology.all_roles(ctx.cluster)
14311431
config = dict((id_, a) for id_ in roles if id_.startswith('host.'))
1432+
elif 'all-roles' in config or 'all-hosts' in config:
1433+
raise ValueError(
1434+
'all-roles/all-hosts may not be combined with any other roles'
1435+
)
14321436
return config
14331437

14341438

0 commit comments

Comments
 (0)