From bcc97ed2212281b20d94d388303575fbb1ffb5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 11 Jan 2016 18:59:15 +0100 Subject: [PATCH] Fill the KeyID member of ErrKeyNotFound in KeyDBStore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Not necessary for the rest of this PR, just a related cleanup.) Signed-off-by: Miloslav Trmač --- signer/keydbstore/keydbstore.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/signer/keydbstore/keydbstore.go b/signer/keydbstore/keydbstore.go index ac57263b3a..ebd0c49ae2 100644 --- a/signer/keydbstore/keydbstore.go +++ b/signer/keydbstore/keydbstore.go @@ -117,7 +117,7 @@ func (s *KeyDBStore) GetKey(name string) (data.PrivateKey, string, error) { // Retrieve the GORM private key from the database dbPrivateKey := GormPrivateKey{} if s.db.Where(&GormPrivateKey{KeyID: name}).First(&dbPrivateKey).RecordNotFound() { - return nil, "", trustmanager.ErrKeyNotFound{} + return nil, "", trustmanager.ErrKeyNotFound{KeyID: name} } // Get the passphrase to use for this key @@ -165,7 +165,7 @@ func (s *KeyDBStore) RemoveKey(keyID string) error { // Retrieve the GORM private key from the database dbPrivateKey := GormPrivateKey{} if s.db.Where(&GormPrivateKey{KeyID: keyID}).First(&dbPrivateKey).RecordNotFound() { - return trustmanager.ErrKeyNotFound{} + return trustmanager.ErrKeyNotFound{KeyID: keyID} } // Delete the key from the database @@ -179,7 +179,7 @@ func (s *KeyDBStore) RotateKeyPassphrase(name, newPassphraseAlias string) error // Retrieve the GORM private key from the database dbPrivateKey := GormPrivateKey{} if s.db.Where(&GormPrivateKey{KeyID: name}).First(&dbPrivateKey).RecordNotFound() { - return trustmanager.ErrKeyNotFound{} + return trustmanager.ErrKeyNotFound{KeyID: name} } // Get the current passphrase to use for this key