-include acl-inaccessible hosts in ineligible_host_queues blocks. This should make metahosts obey ACLs.
-recompute blocks for all non-complete jobs after any acl changes
-make the scheduler clear out blocks for completed jobs
This is messier than I would've liked because it required two things Django is not very good at - subqueries and notification of every time a many-to-many relationship changes. I used a custom manager and a custom manipulator to get around the two, respectively, in as clean a way I could find.
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1459 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py
index 8c87340..1e74db8 100644
--- a/frontend/afe/rpc_interface.py
+++ b/frontend/afe/rpc_interface.py
@@ -152,21 +152,25 @@
def acl_group_add_users(id, users):
users = [models.User.smart_get(user) for user in users]
models.AclGroup.smart_get(id).users.add(*users)
+ models.Job.recompute_all_blocks()
def acl_group_remove_users(id, users):
users = [models.User.smart_get(user) for user in users]
models.AclGroup.smart_get(id).users.remove(*users)
+ models.Job.recompute_all_blocks()
def acl_group_add_hosts(id, hosts):
hosts = [models.Host.smart_get(host) for host in hosts]
models.AclGroup.smart_get(id).hosts.add(*hosts)
+ models.Job.recompute_all_blocks()
def acl_group_remove_hosts(id, hosts):
hosts = [models.Host.smart_get(host) for host in hosts]
models.AclGroup.smart_get(id).hosts.remove(*hosts)
+ models.Job.recompute_all_blocks()
def delete_acl_group(id):