From 48a313c6ccf47cbb2e6c56071c4b169069540668 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 11 Aug 2020 17:41:51 +0530 Subject: [PATCH] cephfs: replace Errorf with ErrorLog in mount replace Errorf with ErrorLog in mount for context based logging. Signed-off-by: Madhu Rajanna --- internal/cephfs/nodeserver.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/cephfs/nodeserver.go b/internal/cephfs/nodeserver.go index af6eb4b03..134aa1dde 100644 --- a/internal/cephfs/nodeserver.go +++ b/internal/cephfs/nodeserver.go @@ -139,14 +139,14 @@ func (*NodeServer) mount(ctx context.Context, volOptions *volumeOptions, req *cs cr, err := getCredentialsForVolume(volOptions, req) if err != nil { - klog.Errorf(util.Log(ctx, "failed to get ceph credentials for volume %s: %v"), volID, err) + util.ErrorLog(ctx, "failed to get ceph credentials for volume %s: %v", volID, err) return status.Error(codes.Internal, err.Error()) } defer cr.DeleteCredentials() m, err := newMounter(volOptions) if err != nil { - klog.Errorf(util.Log(ctx, "failed to create mounter for volume %s: %v"), volID, err) + util.ErrorLog(ctx, "failed to create mounter for volume %s: %v", volID, err) return status.Error(codes.Internal, err.Error()) } @@ -173,8 +173,8 @@ func (*NodeServer) mount(ctx context.Context, volOptions *volumeOptions, req *cs } if err = m.mount(ctx, stagingTargetPath, cr, volOptions); err != nil { - klog.Errorf(util.Log(ctx, - "failed to mount volume %s: %v Check dmesg logs if required."), + util.ErrorLog(ctx, + "failed to mount volume %s: %v Check dmesg logs if required.", volID, err) return status.Error(codes.Internal, err.Error()) @@ -183,10 +183,10 @@ func (*NodeServer) mount(ctx context.Context, volOptions *volumeOptions, req *cs // #nosec - allow anyone to write inside the stagingtarget path err = os.Chmod(stagingTargetPath, 0777) if err != nil { - klog.Errorf(util.Log(ctx, "failed to change stagingtarget path %s permission for volume %s: %v"), stagingTargetPath, volID, err) + util.ErrorLog(ctx, "failed to change stagingtarget path %s permission for volume %s: %v", stagingTargetPath, volID, err) uErr := unmountVolume(ctx, stagingTargetPath) if uErr != nil { - klog.Errorf(util.Log(ctx, "failed to umount stagingtarget path %s for volume %s: %v"), stagingTargetPath, volID, uErr) + util.ErrorLog(ctx, "failed to umount stagingtarget path %s for volume %s: %v", stagingTargetPath, volID, uErr) } return status.Error(codes.Internal, err.Error()) }