Skip to content

Commit

Permalink
remove redundant error volume condition
Browse files Browse the repository at this point in the history
  • Loading branch information
fengzixu committed Jun 17, 2020
1 parent 4c42647 commit f29b9bf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions mock/service/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,11 @@ func (s *service) NodeGetVolumeStats(ctx context.Context,
}

if len(req.GetVolumeId()) == 0 {
resp.VolumeCondition.Abnormal = true
resp.VolumeCondition.Message = "Volume ID cannot be empty"
return resp, status.Error(codes.InvalidArgument, "Volume ID cannot be empty")
return nil, status.Error(codes.InvalidArgument, "Volume ID cannot be empty")
}

if len(req.GetVolumePath()) == 0 {
resp.VolumeCondition.Abnormal = true
resp.VolumeCondition.Message = "Volume path cannot be empty"
return resp, status.Error(codes.InvalidArgument, "Volume Path cannot be empty")
return nil, status.Error(codes.InvalidArgument, "Volume Path cannot be empty")
}

i, v := s.findVolNoLock("id", req.VolumeId)
Expand Down

0 comments on commit f29b9bf

Please sign in to comment.