From 5802265b287eedf450b934625c003ee121295d80 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 11 Aug 2020 16:55:36 +0530 Subject: [PATCH] cephfs: replace klog.Error with util.ErrorLog in createSnapshot replace klog.Error with util.ErrorLog in createSnapshot for context based logging. Signed-off-by: Madhu Rajanna --- internal/cephfs/controllerserver.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cephfs/controllerserver.go b/internal/cephfs/controllerserver.go index 901fce96f..eeea73ab3 100644 --- a/internal/cephfs/controllerserver.go +++ b/internal/cephfs/controllerserver.go @@ -449,13 +449,13 @@ func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateS sourceVolID := req.GetSourceVolumeId() // Existence and conflict checks if acquired := cs.SnapshotLocks.TryAcquire(requestName); !acquired { - klog.Errorf(util.Log(ctx, util.SnapshotOperationAlreadyExistsFmt), requestName) + util.ErrorLog(ctx, util.SnapshotOperationAlreadyExistsFmt, requestName) return nil, status.Errorf(codes.Aborted, util.SnapshotOperationAlreadyExistsFmt, requestName) } defer cs.SnapshotLocks.Release(requestName) if err = cs.OperationLocks.GetSnapshotCreateLock(sourceVolID); err != nil { - klog.Error(util.Log(ctx, err.Error())) + util.ErrorLog(ctx, err.Error()) return nil, status.Error(codes.Aborted, err.Error()) } @@ -486,7 +486,7 @@ func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateS // lock out parallel snapshot create operations if acquired := cs.VolumeLocks.TryAcquire(sourceVolID); !acquired { - klog.Errorf(util.Log(ctx, util.VolumeOperationAlreadyExistsFmt), sourceVolID) + util.ErrorLog(ctx, util.VolumeOperationAlreadyExistsFmt, sourceVolID) return nil, status.Errorf(codes.Aborted, util.VolumeOperationAlreadyExistsFmt, sourceVolID) } defer cs.VolumeLocks.Release(sourceVolID)