mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-28 17:22:41 +00:00
move logs into if block (#29634)
This commit is contained in:
@@ -435,11 +435,10 @@ func (b *backend) pathConfigClientCreateUpdate(ctx context.Context, req *logical
|
||||
|
||||
if changedCreds || changedOtherConfig || req.Operation == logical.CreateOperation {
|
||||
if err := req.Storage.Put(ctx, entry); err != nil {
|
||||
b.Logger().Error("write to storage failed but the rotation manager still succeeded.",
|
||||
"operation", performedRotationManagerOpern, "mount", req.MountPoint, "path", req.Path)
|
||||
|
||||
wrappedError := err
|
||||
if performedRotationManagerOpern != "" {
|
||||
b.Logger().Error("write to storage failed but the rotation manager still succeeded.",
|
||||
"operation", performedRotationManagerOpern, "mount", req.MountPoint, "path", req.Path)
|
||||
wrappedError = fmt.Errorf("write to storage failed but the rotation manager still succeeded; "+
|
||||
"operation=%s, mount=%s, path=%s, storageError=%s", performedRotationManagerOpern, req.MountPoint, req.Path, err)
|
||||
}
|
||||
|
||||
@@ -283,11 +283,10 @@ func (b *backend) pathConfigRootWrite(ctx context.Context, req *logical.Request,
|
||||
|
||||
// Save the config
|
||||
if err := putConfigToStorage(ctx, req, rc); err != nil {
|
||||
b.Logger().Error("write to storage failed but the rotation manager still succeeded.",
|
||||
"operation", performedRotationManagerOpern, "mount", req.MountPoint, "path", req.Path)
|
||||
|
||||
wrappedError := err
|
||||
if performedRotationManagerOpern != "" {
|
||||
b.Logger().Error("write to storage failed but the rotation manager still succeeded.",
|
||||
"operation", performedRotationManagerOpern, "mount", req.MountPoint, "path", req.Path)
|
||||
wrappedError = fmt.Errorf("write to storage failed but the rotation manager still succeeded; "+
|
||||
"operation=%s, mount=%s, path=%s, storageError=%s", performedRotationManagerOpern, req.MountPoint, req.Path, err)
|
||||
}
|
||||
|
||||
@@ -611,11 +611,10 @@ func (b *databaseBackend) connectionWriteHandler() framework.OperationFunc {
|
||||
}
|
||||
err = storeConfig(ctx, req.Storage, name, config)
|
||||
if err != nil {
|
||||
b.Logger().Error("write to storage failed but the rotation manager still succeeded.",
|
||||
"operation", performedRotationManagerOpern, "mount", req.MountPoint, "path", req.Path)
|
||||
|
||||
wrappedError := err
|
||||
if performedRotationManagerOpern != "" {
|
||||
b.Logger().Error("write to storage failed but the rotation manager still succeeded.",
|
||||
"operation", performedRotationManagerOpern, "mount", req.MountPoint, "path", req.Path)
|
||||
wrappedError = fmt.Errorf("write to storage failed but the rotation manager still succeeded; "+
|
||||
"operation=%s, mount=%s, path=%s, storageError=%s", performedRotationManagerOpern, req.MountPoint, req.Path, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user