I'm using fabric to run some tests, each test on each machine. I want to pass a unique index to each run invocation. When not allow duplicate hosts, I'm doing something like:
@task
@parallel
def run_test():
idx = env.hosts.index(env.host)
run('run_test %d' % (idx)
This works fine. However, now I want to run several tests on each machine. I do this by passing the same hostname several times and then setting env.dedupe_hosts = False, however, this breaks the above schema, since now each invocation will get the same index.
Is there any way to do this. I've tried to assign the index using multiprocess locker, but this did not work.
Cheers.