diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-02-22 00:28:42 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-02-22 00:28:42 -0800 |
| commit | 1c233ad986bbbf5de3394c734a1bafebaf67b9e0 (patch) | |
| tree | c212a72f5b2e9414d2ef6d9177d0c08f59f2f3f1 /weed/shell/command_volume_list.go | |
| parent | 151c281f36f1523593ad2777fd66c347934d73fb (diff) | |
| download | seaweedfs-1c233ad986bbbf5de3394c734a1bafebaf67b9e0.tar.xz seaweedfs-1c233ad986bbbf5de3394c734a1bafebaf67b9e0.zip | |
refactoring
Diffstat (limited to 'weed/shell/command_volume_list.go')
| -rw-r--r-- | weed/shell/command_volume_list.go | 10 |
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 } |
