diff options
Diffstat (limited to 'ssh.py')
-rw-r--r-- | ssh.py | 39 |
1 files changed, 19 insertions, 20 deletions
@@ -182,29 +182,28 @@ 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 | with Trace('Call to ssh (check call): %s', ' '.join(check_command)): | 185 | try: |
186 | try: | 186 | Trace(': %s', ' '.join(check_command)) |
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 | 199 | # Ignore excpetions. We we will fall back to the normal command and print |
200 | # print to the log there. | 200 | # 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 | ||
205 | try: | 204 | try: |
206 | with Trace('Call to ssh: %s', ' '.join(command)): | 205 | Trace(': %s', ' '.join(command)) |
207 | p = subprocess.Popen(command) | 206 | p = subprocess.Popen(command) |
208 | except Exception as e: | 207 | except Exception as e: |
209 | self._master_broken.value = True | 208 | self._master_broken.value = True |
210 | print('\nwarn: cannot enable ssh control master for %s:%s\n%s' | 209 | print('\nwarn: cannot enable ssh control master for %s:%s\n%s' |