diff options
Diffstat (limited to 'internal/ssh/client')
| -rw-r--r-- | internal/ssh/client/clientkeypair.go | 14 | ||||
| -rw-r--r-- | internal/ssh/client/knownhostscallback.go | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/internal/ssh/client/clientkeypair.go b/internal/ssh/client/clientkeypair.go index 0e21d0c..b35b25d 100644 --- a/internal/ssh/client/clientkeypair.go +++ b/internal/ssh/client/clientkeypair.go @@ -16,7 +16,7 @@ import ( // GeneratePrivatePublicKeyPairIfNotExists generates a SSH key pair (used by the integration tests) func GeneratePrivatePublicKeyPairIfNotExists(keyPath string, bitSize int) { if _, err := os.Stat(keyPath); err == nil { - dlog.Common.Debug("Private/public key pair already exists", keyPath) + dlog.Client.Debug("Private/public key pair already exists", keyPath) return } GeneratePrivatePublicKeyPair(keyPath, bitSize) @@ -27,27 +27,27 @@ func GeneratePrivatePublicKeyPair(keyPath string, bitSize int) { privateKeyPath := keyPath publicKeyPath := fmt.Sprintf("%s.pub", keyPath) - dlog.Common.Debug("Generating private/public key pair", privateKeyPath, publicKeyPath) + dlog.Client.Debug("Generating private/public key pair", privateKeyPath, publicKeyPath) privateKey, err := generatePrivateKey(bitSize) if err != nil { - dlog.Common.FatalPanic(err) + dlog.Client.FatalPanic(err) } publicKeyBytes, err := generatePublicKey(&privateKey.PublicKey) if err != nil { - dlog.Common.FatalPanic(err) + dlog.Client.FatalPanic(err) } privateKeyBytes := encodePrivateKeyToPEM(privateKey) err = writeKey(privateKeyBytes, privateKeyPath) if err != nil { - dlog.Common.FatalPanic(err) + dlog.Client.FatalPanic(err) } err = writeKey([]byte(publicKeyBytes), publicKeyPath) if err != nil { - dlog.Common.FatalPanic(err) + dlog.Client.FatalPanic(err) } - dlog.Common.Debug("Done generating private/public key pair", privateKeyPath, publicKeyPath) + dlog.Client.Debug("Done generating private/public key pair", privateKeyPath, publicKeyPath) } func generatePrivateKey(bitSize int) (*rsa.PrivateKey, error) { diff --git a/internal/ssh/client/knownhostscallback.go b/internal/ssh/client/knownhostscallback.go index dd58925..393c4c7 100644 --- a/internal/ssh/client/knownhostscallback.go +++ b/internal/ssh/client/knownhostscallback.go @@ -93,7 +93,7 @@ func (c KnownHostsCallback) Wrap() ssh.HostKeyCallback { ipLine: knownhosts.Line([]string{remote.String()}, key), responseCh: make(chan response), } - dlog.Common.Warn("Encountered unknown host", unknown) + dlog.Client.Warn("Encountered unknown host", unknown) // Notify user that there is an unknown host c.unknownCh <- unknown // Wait for user input. @@ -132,7 +132,7 @@ func (c KnownHostsCallback) PromptAddHosts(ctx context.Context) { hosts = []unknownHost{} } case <-ctx.Done(): - dlog.Common.Debug("Stopping goroutine prompting new hosts...") + dlog.Client.Debug("Stopping goroutine prompting new hosts...") return } } @@ -146,7 +146,7 @@ func (c KnownHostsCallback) promptAddHosts(hosts []unknownHost) { select { case <-c.trustAllHostsCh: - dlog.Common.Warn("Trusting host keys of servers", servers) + dlog.Client.Warn("Trusting host keys of servers", servers) c.trustHosts(hosts) return default: @@ -166,7 +166,7 @@ func (c KnownHostsCallback) promptAddHosts(hosts []unknownHost) { c.trustHosts(hosts) }, EndCallback: func() { - dlog.Common.Info("Added hosts to known hosts file", c.knownHostsPath) + dlog.Client.Info("Added hosts to known hosts file", c.knownHostsPath) }, } p.Add(a) @@ -179,7 +179,7 @@ func (c KnownHostsCallback) promptAddHosts(hosts []unknownHost) { c.trustHosts(hosts) }, EndCallback: func() { - dlog.Common.Info("Added hosts to known hosts file", c.knownHostsPath) + dlog.Client.Info("Added hosts to known hosts file", c.knownHostsPath) }, } p.Add(a) @@ -191,7 +191,7 @@ func (c KnownHostsCallback) promptAddHosts(hosts []unknownHost) { c.dontTrustHosts(hosts) }, EndCallback: func() { - dlog.Common.Info("Didn't add hosts to known hosts file", c.knownHostsPath) + dlog.Client.Info("Didn't add hosts to known hosts file", c.knownHostsPath) }, } p.Add(a) |
