Thread within for loop

Iranna Mathapati iranna.gani28 at
Sat Apr 1 02:58:08 EDT 2017

Hi team,

I tried to run fallowing run,

        *jobs = []*
*        sniffer1 = threading.Thread(target=validate_traffic_stats_dy,args=
*        jobs.append(sniffer1)*

*        sniffer2 =
*        jobs.append(sniffer2)*

*       for local_ip, global_ip in zip(src_ipv4_local_list_st_in_new,
*            sniffer3 =
threading.Thread(target=create_static_nat_entries,args = (uut2_hdl2,
direction_in, local_ip,global_ip,))*
*            jobs.append(sniffer3) *

*        # Start the threads*
*        for j in jobs:*
*            j.start()*
*            time.sleep(2)*

*        # Ensure all of the threads have finished*
*        for j in jobs:*
*  j.join()*

while runing i got below error and hitting in sniffer3 thread

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/auto/pysw/cel55/python/2.7.8/lib/python2.7/", line
810, in __bootstrap_inner
  File "/auto/pysw/cel55/python/2.7.8/lib/python2.7/", line
763, in run
    self.__target(*self.__args, **self.__kwargs)
line 50, in create_static_nat_entries
    {2} add-route'.format(protocol, inside_local_ip, inside_global_ip))
  File "../../lib/", line 899, in iconfig
    self.hdl.expect('# $')
line 1451, in expect
    timeout, searchwindowsize)
line 1466, in expect_list
    timeout, searchwindowsize)
line 1568, in expect_loop
    raise TIMEOUT(str(err) + '\n' + str(self))
TIMEOUT: Timeout exceeded.
<pexpect.spawn object at 0xf634688c>
version: 3.3
command: /usr/bin/telnet
args: ['/usr/bin/telnet', '', '2025']
searcher: <pexpect.searcher_re object at 0xf616396c>
buffer (last 100 chars): '\rSeoul(config)# config
before (last 100 chars): '\rSeoul(config)# config
after: <class 'pexpect.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 17297
child_fd: 8
closed: False
timeout: 500
delimiter: <class 'pexpect.EOF'>
logfile: <open file
mode 'a' at 0xf63193e8>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1

Can you please let me know what is the issue.

Iranna M

More information about the Python-list mailing list