Minor ports
This commit is contained in:
parent
710e8f2d4c
commit
7865143c1d
|
@ -206,12 +206,19 @@ func (c *ServerCommand) Run(args []string) int {
|
|||
|
||||
// Ensure that the seal finalizer is called, even if using verify-only
|
||||
defer func() {
|
||||
err = seal.Finalize()
|
||||
if err != nil {
|
||||
c.Ui.Output(fmt.Sprintf("Error finalizing seals: %v", err))
|
||||
if seal != nil {
|
||||
err = seal.Finalize()
|
||||
if err != nil {
|
||||
c.Ui.Output(fmt.Sprintf("Error finalizing seals: %v", err))
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
if seal == nil {
|
||||
c.Ui.Error(fmt.Sprintf("Could not create seal"))
|
||||
return 1
|
||||
}
|
||||
|
||||
coreConfig := &vault.CoreConfig{
|
||||
Physical: backend,
|
||||
RedirectAddr: config.Backend.RedirectAddr,
|
||||
|
|
|
@ -15,7 +15,7 @@ func TestCore_Init(t *testing.T) {
|
|||
c, conf := testCore_NewTestCore(t, nil)
|
||||
testCore_Init_Common(t, c, conf, &SealConfig{SecretShares: 5, SecretThreshold: 3}, nil)
|
||||
|
||||
c, conf = testCore_NewTestCore(t, &TestSeal{})
|
||||
c, conf = testCore_NewTestCore(t, newTestSeal(t))
|
||||
bc, rc := TestSealDefConfigs()
|
||||
rc.SecretShares = 4
|
||||
rc.SecretThreshold = 2
|
||||
|
|
|
@ -15,6 +15,10 @@ type TestSeal struct {
|
|||
recoveryConfig *SealConfig
|
||||
}
|
||||
|
||||
func newTestSeal(t *testing.T) Seal {
|
||||
return &TestSeal{}
|
||||
}
|
||||
|
||||
func (d *TestSeal) checkCore() error {
|
||||
if d.defseal.core == nil {
|
||||
return fmt.Errorf("seal does not have a core set")
|
||||
|
|
Loading…
Reference in New Issue