simplify parsing filer host and port
This commit is contained in:
@@ -37,11 +37,6 @@ func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.
|
||||
return nil
|
||||
}
|
||||
|
||||
filerServer, filerPort, path, err := commandEnv.parseUrl(findInputDirectory(nil))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fileName := args[len(args)-1]
|
||||
|
||||
dst, err := os.OpenFile(fileName, os.O_RDONLY, 0644)
|
||||
@@ -52,7 +47,7 @@ func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.
|
||||
|
||||
var dirCount, fileCount uint64
|
||||
|
||||
err = commandEnv.withFilerClient(filerServer, filerPort, func(client filer_pb.SeaweedFilerClient) error {
|
||||
err = commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
|
||||
|
||||
sizeBuf := make([]byte, 4)
|
||||
|
||||
@@ -98,7 +93,7 @@ func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.
|
||||
|
||||
if err == nil {
|
||||
fmt.Fprintf(writer, "\ntotal %d directories, %d files", dirCount, fileCount)
|
||||
fmt.Fprintf(writer, "\n%s is loaded to http://%s:%d%s\n", fileName, filerServer, filerPort, path)
|
||||
fmt.Fprintf(writer, "\n%s is loaded.\n", fileName)
|
||||
}
|
||||
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user