diff options
Diffstat (limited to 'weed/shell')
| -rw-r--r-- | weed/shell/command_collection_list.go | 10 | ||||
| -rw-r--r-- | weed/shell/command_volume_list.go | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/weed/shell/command_collection_list.go b/weed/shell/command_collection_list.go index 34a406d67..0797e56fb 100644 --- a/weed/shell/command_collection_list.go +++ b/weed/shell/command_collection_list.go @@ -3,6 +3,7 @@ package shell import ( "context" "fmt" + "github.com/chrislusf/seaweedfs/weed/pb/master_pb" "io" ) @@ -21,9 +22,14 @@ func (c *commandCollectionList) Help() string { return "# list all collections" } -func (c *commandCollectionList) Do(args []string, commandEnv *commandEnv, writer io.Writer) error { +func (c *commandCollectionList) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) { - resp, err := commandEnv.masterClient.CollectionList(context.Background()) + var resp *master_pb.CollectionListResponse + + err = commandEnv.masterClient.WithClient(context.Background(), func(ctx context.Context, client master_pb.SeaweedClient) error { + resp, err = client.CollectionList(ctx, &master_pb.CollectionListRequest{}) + return err + }) if err != nil { return err 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 } |
