emulate/traffic: fix next usage
authorJoe Guo <joeg@catalyst.net.nz>
Wed, 20 Jun 2018 04:34:44 +0000 (16:34 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 15 Aug 2018 05:08:25 +0000 (07:08 +0200)
In commit b0c9de820c07d77c03b80505cb811ac1dac0808f, line 343:

    self.next_conversation_id = itertools.count().next

was changed to:

    self.next_conversation_id = next(itertools.count())

which is not correct, the first one is a function, the second one is a
int. This patch fixed it.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13573

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/emulate/traffic.py

index c96530b01643c490aa6ecdf3c00c665034b6dac7..fc31d70f55175b99b532148c615433aa3b16486a 100644 (file)
@@ -340,7 +340,7 @@ class ReplayContext(object):
         self.last_netlogon_bad        = False
         self.last_samlogon_bad        = False
         self.generate_ldap_search_tables()
-        self.next_conversation_id = next(itertools.count())
+        self.next_conversation_id = itertools.count()
 
     def generate_ldap_search_tables(self):
         session = system_session()
@@ -882,7 +882,7 @@ class Conversation(object):
             gap = t - now
             print("gap is now %f" % gap, file=sys.stderr)
 
-        self.conversation_id = context.next_conversation_id()
+        self.conversation_id = next(context.next_conversation_id)
         pid = os.fork()
         if pid != 0:
             return pid