Allow arbitrary ssh args
This commit is contained in:
parent
bda1bb05fd
commit
8d7de7172a
1 changed files with 14 additions and 13 deletions
|
|
@ -508,8 +508,8 @@ class DebugSession( object ):
|
||||||
|
|
||||||
# TODO: Use the 'tarminate' request if supportsTerminateRequest set
|
# TODO: Use the 'tarminate' request if supportsTerminateRequest set
|
||||||
|
|
||||||
|
|
||||||
def _PrepareAttach( self, adapter_config, launch_config ):
|
def _PrepareAttach( self, adapter_config, launch_config ):
|
||||||
|
|
||||||
atttach_config = adapter_config.get( 'attach' )
|
atttach_config = adapter_config.get( 'attach' )
|
||||||
|
|
||||||
if not atttach_config:
|
if not atttach_config:
|
||||||
|
|
@ -520,13 +520,9 @@ class DebugSession( object ):
|
||||||
# e.g. expand variables when we use them, not all at once. This would
|
# e.g. expand variables when we use them, not all at once. This would
|
||||||
# remove the whole %PID% hack.
|
# remove the whole %PID% hack.
|
||||||
remote = atttach_config[ 'remote' ]
|
remote = atttach_config[ 'remote' ]
|
||||||
ssh = [ 'ssh' ]
|
ssh = self._GetSSHCommand( remote )
|
||||||
|
|
||||||
if 'account' in remote:
|
|
||||||
ssh.append( remote[ 'account' ] + '@' + remote[ 'host' ] )
|
|
||||||
else:
|
|
||||||
ssh.append( remote[ 'host' ] )
|
|
||||||
|
|
||||||
|
# FIXME: Why does this not use self._GetCommands ?
|
||||||
cmd = ssh + remote[ 'pidCommand' ]
|
cmd = ssh + remote[ 'pidCommand' ]
|
||||||
|
|
||||||
self._logger.debug( 'Getting PID: %s', cmd )
|
self._logger.debug( 'Getting PID: %s', cmd )
|
||||||
|
|
@ -574,12 +570,7 @@ class DebugSession( object ):
|
||||||
|
|
||||||
if 'remote' in run_config:
|
if 'remote' in run_config:
|
||||||
remote = run_config[ 'remote' ]
|
remote = run_config[ 'remote' ]
|
||||||
ssh = [ 'ssh' ]
|
ssh = self._GetSSHCommand( remote )
|
||||||
if 'account' in remote:
|
|
||||||
ssh.append( remote[ 'account' ] + '@' + remote[ 'host' ] )
|
|
||||||
else:
|
|
||||||
ssh.append( remote[ 'host' ] )
|
|
||||||
|
|
||||||
commands = self._GetCommands( remote, 'run' )
|
commands = self._GetCommands( remote, 'run' )
|
||||||
|
|
||||||
for index, command in enumerate( commands ):
|
for index, command in enumerate( commands ):
|
||||||
|
|
@ -599,6 +590,16 @@ class DebugSession( object ):
|
||||||
full_cmd )
|
full_cmd )
|
||||||
|
|
||||||
|
|
||||||
|
def _GetSSHCommand( self, remote ):
|
||||||
|
ssh = [ 'ssh' ] + remote.get( 'ssh', {} ).get( 'args', [] )
|
||||||
|
if 'account' in remote:
|
||||||
|
ssh.append( remote[ 'account' ] + '@' + remote[ 'host' ] )
|
||||||
|
else:
|
||||||
|
ssh.append( remote[ 'host' ] )
|
||||||
|
|
||||||
|
return ssh
|
||||||
|
|
||||||
|
|
||||||
def _GetCommands( self, remote, pfx ):
|
def _GetCommands( self, remote, pfx ):
|
||||||
commands = remote.get( pfx + 'Commands', None )
|
commands = remote.get( pfx + 'Commands', None )
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue