traffic_replay: Re-organize assignments to be group-based
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 31 Oct 2018 03:50:27 +0000 (16:50 +1300)
committerTim Beale <timbeale@samba.org>
Sun, 4 Nov 2018 22:55:16 +0000 (23:55 +0100)
commita29ee3a7458de89ae548077013c31cc08cb747f9
tree7887353b9f913ae6d491f8370653473b90256b33
parent5ad7fc73355604daafddcf074f6b998a43aac9f7
traffic_replay: Re-organize assignments to be group-based

We can speed up writing the group memberships by adding multiple users
to a group in a single DB modify operation.

To do this, we first need to reorganize the assignments so instead
of being a set of tuples, it's a dictionary where key=group and
value=list-of-users-in-group.

add_users_to_groups() now iterates through the users/groups slightly
differently, but mostly it's just indentation changes. We haven't
changed the number of DB operations yet - we'll do that in the next
patch.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/emulate/traffic.py