Added comments to changes the error message

This commit is contained in:
vishalnayak 2016-02-03 11:35:47 -05:00
parent f1facb0f9f
commit a10888f1f1
1 changed files with 7 additions and 2 deletions

View File

@ -1183,9 +1183,14 @@ func (c *Core) Seal(token string) (retErr error) {
}
}
if err != nil {
// Since there is no token store in standby nodes, sealing cannot
// be done. Ideally, the request has to be forwarded to leader node
// for validation and the operation should be performed. But for now,
// just returning with an error and recommending a vault restart, which
// essentially does the same thing.
if c.standby {
c.logger.Printf("[ERR] core: cannot seal the vault in standby mode")
return errors.New("Vault cannot be sealed in standby mode")
c.logger.Printf("[ERR] core: vault cannot be sealed when in standby mode; please restart instead")
return errors.New("vault cannot be sealed when in standby mode; please restart instead")
}
return err
}