refactoring
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user