Infer the atomic group automatically by looking at the meta host when
creating a job.
This means that the -G atomicgroupname parameter on cli/atest is unnecessary
when giving an atomic group label name directly.
It also makes it possible to schedule onto atomic group labels via the GUI
rather than getting an error message.
Signed-off-by: Gregory Smith <gps@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3324 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/rpc_utils.py b/frontend/afe/rpc_utils.py
index 839b1b3..524fda6 100644
--- a/frontend/afe/rpc_utils.py
+++ b/frontend/afe/rpc_utils.py
@@ -420,14 +420,16 @@
if label.atomic_group and not atomic_group:
raise model_logic.ValidationError(
{'atomic_group_name':
- 'Some meta_hosts or dependencies require an atomic group '
- 'but no atomic_group_name was specified for this job.'})
+ 'Dependency %r requires an atomic group but no '
+ 'atomic_group_name or meta_host in an atomic group was '
+ 'specified for this job.' % label.name})
elif (label.atomic_group and
label.atomic_group.name != atomic_group.name):
raise model_logic.ValidationError(
{'atomic_group_name':
- 'Some meta_hosts or dependencies require an atomic group '
- 'other than the one requested for this job.'})
+ 'meta_hosts or dependency %r requires atomic group '
+ '%r instead of the supplied atomic_group_name=%r.' %
+ (label.name, label.atomic_group.name, atomic_group.name)})
job = models.Job.create(owner=owner, options=options,
hosts=all_host_objects)