File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -41,18 +41,20 @@ class CloudInstaller {
4141 debug : undefined
4242 } ;
4343
44- const client = new Client ( ) ;
44+ const connection = new Client ( ) ;
4545 return new Promise < string > ( ( F , R ) => {
46- client . on ( 'ready' , ( ) => {
46+ connection . on ( 'ready' , ( ) => {
4747 log . debug ( 'logged into server' ) ;
48- client . exec ( INSTALL_COMMAND , ( e : Error , stream : ssh2 . Channel ) => {
48+ connection . exec ( INSTALL_COMMAND , ( e : Error , stream : ssh2 . Channel ) => {
4949 if ( e ) {
50+ connection . end ( ) ;
5051 R ( {
5152 message : 'could not execute command: ' + e . message
5253 } ) ;
5354 return ;
5455 }
5556 stream . on ( 'end' , ( ) => {
57+ connection . end ( ) ;
5658 R ( {
5759 message : 'invitation URL not found'
5860 } ) ;
@@ -74,9 +76,9 @@ class CloudInstaller {
7476 message : 'could not login: ' + e . message
7577 } ) ;
7678 } ) . on ( 'end' , ( ) => {
77- log . debug ( 'end' ) ;
79+ log . debug ( 'connection end' ) ;
7880 } ) . on ( 'close' , ( hadError : boolean ) => {
79- log . debug ( 'close (hadError: %1) ' , hadError ) ;
81+ log . debug ( 'connection close, with%1 error ' , ( hadError ? '' : 'out' ) ) ;
8082 } ) . connect ( connectConfig ) ;
8183 } ) ;
8284 }
You can’t perform that action at this time.
0 commit comments