aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_list.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2024-12-10 18:43:59 +0200
committerGitHub <noreply@github.com>2024-12-10 08:43:59 -0800
commitff1392f7f4a854d17dea13f6738a219d7bb2cf96 (patch)
tree466a8d49a2015d4ae98b45c251320bc2bdd4805e /weed/shell/command_volume_list.go
parent4f6c989309c0e8c5ab887ddc089f321401795b7d (diff)
downloadseaweedfs-ff1392f7f4a854d17dea13f6738a219d7bb2cf96.tar.xz
seaweedfs-ff1392f7f4a854d17dea13f6738a219d7bb2cf96.zip
[shell] use constant for hdd of type (#6337)
use constant for hdd of type
Diffstat (limited to 'weed/shell/command_volume_list.go')
-rw-r--r--weed/shell/command_volume_list.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/shell/command_volume_list.go b/weed/shell/command_volume_list.go
index fe7d5f732..74655df12 100644
--- a/weed/shell/command_volume_list.go
+++ b/weed/shell/command_volume_list.go
@@ -6,6 +6,7 @@ import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/erasure_coding"
+ "github.com/seaweedfs/seaweedfs/weed/storage/types"
"golang.org/x/exp/slices"
"path/filepath"
"strings"
@@ -72,7 +73,7 @@ func diskInfosToString(diskInfos map[string]*master_pb.DiskInfo) string {
var buf bytes.Buffer
for diskType, diskInfo := range diskInfos {
if diskType == "" {
- diskType = "hdd"
+ diskType = types.HddType
}
fmt.Fprintf(&buf, " %s(volume:%d/%d active:%d free:%d remote:%d)", diskType, diskInfo.VolumeCount, diskInfo.MaxVolumeCount, diskInfo.ActiveVolumeCount, diskInfo.FreeVolumeCount, diskInfo.RemoteVolumeCount)
}
@@ -162,7 +163,7 @@ func (c *commandVolumeList) writeDiskInfo(writer io.Writer, t *master_pb.DiskInf
var s statistics
diskType := t.Type
if diskType == "" {
- diskType = "hdd"
+ diskType = types.HddType
}
output(verbosityLevel >= 4, writer, " Disk %s(%s)\n", diskType, diskInfoToString(t))
slices.SortFunc(t.VolumeInfos, func(a, b *master_pb.VolumeInformationMessage) int {