File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Hologram/Network/Modem/ModemMode Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,10 @@ def __shut_down_existing_ppp_session(self):
7878 for pid in pid_list :
7979 self .logger .info ('Killing pid %s that currently have an active PPP session' ,
8080 pid )
81- psutil .Process (pid ).terminate ()
81+ process = psutil .Process (pid )
82+ process .terminate ()
83+ # Wait at least 10 seconds for the process to terminate
84+ process .wait (10 )
8285
8386 def __check_for_existing_ppp_sessions (self ):
8487
Original file line number Diff line number Diff line change @@ -73,7 +73,9 @@ def run_modem_disconnect(args):
7373 if 'pppd' in pinfo ['name' ]:
7474 print ('Found existing PPP session on pid: %s' % pinfo ['pid' ])
7575 print ('Killing pid %s now' % pinfo ['pid' ])
76- psutil .Process (pinfo ['pid' ]).terminate ()
76+ process = psutil .Process (pinfo ['pid' ])
77+ process .terminate ()
78+ process .wait ()
7779
7880def run_modem_signal (args ):
7981 cloud = CustomCloud (None , network = 'cellular' )
Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ def run_network_disconnect(args):
4040 if 'pppd' in pinfo ['name' ]:
4141 print ('Found existing PPP session on pid: %s' % pinfo ['pid' ])
4242 print ('Killing pid %s now' % pinfo ['pid' ])
43- psutil .Process (pinfo ['pid' ]).terminate ()
43+ process = psutil .Process (pinfo ['pid' ])
44+ process .terminate ()
45+ process .wait ()
4446
4547_run_handlers = {
4648 'network_connect' : run_network_connect ,
You can’t perform that action at this time.
0 commit comments