aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_list.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@uber.com>2019-03-19 05:19:37 -0700
committerChris Lu <chris.lu@uber.com>2019-03-19 05:19:37 -0700
commiteb4a54d9fe865eafb4de12db96b3e668b333fd1a (patch)
tree1b98cca002c99c2e74abc5cc46a51e61b982df89 /weed/shell/command_volume_list.go
parentece9d133122fd15faa4efd1b4cec34974e3b37d0 (diff)
downloadseaweedfs-eb4a54d9fe865eafb4de12db96b3e668b333fd1a.tar.xz
seaweedfs-eb4a54d9fe865eafb4de12db96b3e668b333fd1a.zip
refactoring
Diffstat (limited to 'weed/shell/command_volume_list.go')
-rw-r--r--weed/shell/command_volume_list.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/weed/shell/command_volume_list.go b/weed/shell/command_volume_list.go
index 971e18f10..52ac4865a 100644
--- a/weed/shell/command_volume_list.go
+++ b/weed/shell/command_volume_list.go
@@ -22,16 +22,18 @@ func (c *commandVolumeList) Help() string {
return "# list all volumes"
}
-func (c *commandVolumeList) Do(args []string, commandEnv *commandEnv, writer io.Writer) error {
-
- resp, err := commandEnv.masterClient.VolumeList(context.Background())
+func (c *commandVolumeList) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
+ var resp *master_pb.VolumeListResponse
+ err = commandEnv.masterClient.WithClient(context.Background(), func(ctx context.Context, client master_pb.SeaweedClient) error {
+ resp, err = client.VolumeList(ctx, &master_pb.VolumeListRequest{})
+ return err
+ })
if err != nil {
return err
}
writeTopologyInfo(writer, resp.TopologyInfo)
-
return nil
}