diff --git a/helper/ssh/default_key_pair.go b/helper/ssh/default_key_pair.go deleted file mode 100644 index e5c68a36d..000000000 --- a/helper/ssh/default_key_pair.go +++ /dev/null @@ -1,28 +0,0 @@ -package ssh - -type defaultKeyPair struct { -} - -func (o defaultKeyPair) Type() KeyPairType { - return Default -} - -func (o defaultKeyPair) Bits() int { - return 0 -} - -func (o defaultKeyPair) Name() string { - return "" -} - -func (o defaultKeyPair) Description() string { - return "" -} - -func (o defaultKeyPair) PrivateKeyPemBlock() []byte { - return []byte{} -} - -func (o defaultKeyPair) PublicKeyAuthorizedKeysLine(nl NewLineOption) []byte { - return []byte{} -} diff --git a/helper/ssh/key_pair.go b/helper/ssh/key_pair.go index 3dd0b5fdf..f46455ebf 100644 --- a/helper/ssh/key_pair.go +++ b/helper/ssh/key_pair.go @@ -139,7 +139,7 @@ func (o *defaultKeyPairBuilder) Build() (KeyPair, error) { return o.newEcdsaKeyPair() } - return defaultKeyPair{}, fmt.Errorf("Unsupported keypair type: %s", o.kind.String()) + return nil, fmt.Errorf("Cannot generate SSH key pair - unsupported key pair type: %s", o.kind.String()) } // preallocatedKeyPair returns an SSH key pair based on user @@ -197,7 +197,7 @@ func (o *defaultKeyPairBuilder) preallocatedKeyPair() (KeyPair, error) { }, nil } - return &defaultKeyPair{}, fmt.Errorf("Unknown ssh key pair type") + return nil, fmt.Errorf("Cannot parse preallocated key pair - unknown ssh key pair type") } // newEcdsaKeyPair returns a new ECDSA SSH key pair.