summaryrefslogtreecommitdiffstats
path: root/ssh.py
diff options
context:
space:
mode:
Diffstat (limited to 'ssh.py')
-rw-r--r--ssh.py39
1 files changed, 20 insertions, 19 deletions
diff --git a/ssh.py b/ssh.py
index 450383dc..004fdbad 100644
--- a/ssh.py
+++ b/ssh.py
@@ -182,28 +182,29 @@ class ProxyManager:
182 # be important because we can't tell that that 'git@myhost.com' is the same 182 # be important because we can't tell that that 'git@myhost.com' is the same
183 # as 'myhost.com' where "User git" is setup in the user's ~/.ssh/config file. 183 # as 'myhost.com' where "User git" is setup in the user's ~/.ssh/config file.
184 check_command = command_base + ['-O', 'check'] 184 check_command = command_base + ['-O', 'check']
185 try: 185 with Trace('Call to ssh (check call): %s', ' '.join(check_command)):
186 Trace(': %s', ' '.join(check_command)) 186 try:
187 check_process = subprocess.Popen(check_command, 187 check_process = subprocess.Popen(check_command,
188 stdout=subprocess.PIPE, 188 stdout=subprocess.PIPE,
189 stderr=subprocess.PIPE) 189 stderr=subprocess.PIPE)
190 check_process.communicate() # read output, but ignore it... 190 check_process.communicate() # read output, but ignore it...
191 isnt_running = check_process.wait() 191 isnt_running = check_process.wait()
192 192
193 if not isnt_running: 193 if not isnt_running:
194 # Our double-check found that the master _was_ infact running. Add to 194 # Our double-check found that the master _was_ infact running. Add to
195 # the list of keys. 195 # the list of keys.
196 self._master_keys[key] = True 196 self._master_keys[key] = True
197 return True 197 return True
198 except Exception: 198 except Exception:
199 # Ignore excpetions. We we will fall back to the normal command and print 199 # Ignore excpetions. We we will fall back to the normal command and
200 # to the log there. 200 # print to the log there.
201 pass 201 pass
202 202
203 command = command_base[:1] + ['-M', '-N'] + command_base[1:] 203 command = command_base[:1] + ['-M', '-N'] + command_base[1:]
204 p = None
204 try: 205 try:
205 Trace(': %s', ' '.join(command)) 206 with Trace('Call to ssh: %s', ' '.join(command)):
206 p = subprocess.Popen(command) 207 p = subprocess.Popen(command)
207 except Exception as e: 208 except Exception as e:
208 self._master_broken.value = True 209 self._master_broken.value = True
209 print('\nwarn: cannot enable ssh control master for %s:%s\n%s' 210 print('\nwarn: cannot enable ssh control master for %s:%s\n%s'