File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -527,7 +527,8 @@ def _start_keepalive(self):
527527 args ,
528528 stdin = subprocess .PIPE ,
529529 stdout = subprocess .PIPE ,
530- stderr = subprocess .PIPE ,
530+ stderr = subprocess .STDOUT ,
531+ encoding = "utf-8" ,
531532 )
532533
533534 self .logger .debug ('Started keepalive for %s' , self .networkservice .address )
@@ -540,12 +541,19 @@ def _stop_keepalive(self):
540541
541542 self .logger .debug ('Stopping keepalive for %s' , self .networkservice .address )
542543
544+ stdout = None
543545 try :
544- self ._keepalive .communicate (timeout = 60 )
546+ stdout , _ = self ._keepalive .communicate (timeout = 60 )
545547 except subprocess .TimeoutExpired :
546548 self ._keepalive .kill ()
547-
548- try :
549- self ._keepalive .wait (timeout = 60 )
549+ try :
550+ # Try again to get output
551+ stdout , _ = self ._keepalive .communicate (timeout = 60 )
552+ except subprocess .TimeoutExpired :
553+ self .logger .warning ("ssh keepalive for %s timed out during termination" , self .networkservice .address )
550554 finally :
551555 self ._keepalive = None
556+
557+ if stdout :
558+ for line in stdout .splitlines ():
559+ self .logger .warning ("Keepalive %s: %s" , self .networkservice .address , line )
You can’t perform that action at this time.
0 commit comments