aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_list.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-02-22 00:28:42 -0800
committerChris Lu <chris.lu@gmail.com>2021-02-22 00:28:42 -0800
commit1c233ad986bbbf5de3394c734a1bafebaf67b9e0 (patch)
treec212a72f5b2e9414d2ef6d9177d0c08f59f2f3f1 /weed/shell/command_volume_list.go
parent151c281f36f1523593ad2777fd66c347934d73fb (diff)
downloadseaweedfs-1c233ad986bbbf5de3394c734a1bafebaf67b9e0.tar.xz
seaweedfs-1c233ad986bbbf5de3394c734a1bafebaf67b9e0.zip
refactoring
Diffstat (limited to 'weed/shell/command_volume_list.go')
-rw-r--r--weed/shell/command_volume_list.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/weed/shell/command_volume_list.go b/weed/shell/command_volume_list.go
index dc8783cd1..9856de10b 100644
--- a/weed/shell/command_volume_list.go
+++ b/weed/shell/command_volume_list.go
@@ -2,7 +2,6 @@ package shell
import (
"bytes"
- "context"
"fmt"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/storage/erasure_coding"
@@ -32,16 +31,13 @@ func (c *commandVolumeList) Help() string {
func (c *commandVolumeList) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
- var resp *master_pb.VolumeListResponse
- err = commandEnv.MasterClient.WithClient(func(client master_pb.SeaweedClient) error {
- resp, err = client.VolumeList(context.Background(), &master_pb.VolumeListRequest{})
- return err
- })
+ // collect topology information
+ topologyInfo, volumeSizeLimitMb, err := collectTopologyInfo(commandEnv)
if err != nil {
return err
}
- writeTopologyInfo(writer, resp.TopologyInfo, resp.VolumeSizeLimitMb)
+ writeTopologyInfo(writer, topologyInfo, volumeSizeLimitMb)
return nil
}