diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-08-04 12:30:18 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-08-04 12:30:18 -0700 |
| commit | d84c31169922d395074b1b256d05aa638462df50 (patch) | |
| tree | a8e35fc46606f2f00b66f3413b26c1c8e7b806c1 /weed/shell/command_remote_mount.go | |
| parent | f6a9ad8001c439e5751fa5488fe6106b185ba8eb (diff) | |
| download | seaweedfs-d84c31169922d395074b1b256d05aa638462df50.tar.xz seaweedfs-d84c31169922d395074b1b256d05aa638462df50.zip | |
refactoring
Diffstat (limited to 'weed/shell/command_remote_mount.go')
| -rw-r--r-- | weed/shell/command_remote_mount.go | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/weed/shell/command_remote_mount.go b/weed/shell/command_remote_mount.go index 55dfb42ca..5cd69f3b0 100644 --- a/weed/shell/command_remote_mount.go +++ b/weed/shell/command_remote_mount.go @@ -79,20 +79,9 @@ func (c *commandRemoteMount) Do(args []string, commandEnv *CommandEnv, writer io func (c *commandRemoteMount) listExistingRemoteStorageMounts(commandEnv *CommandEnv, writer io.Writer) (err error) { // read current mapping - var oldContent []byte - err = commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { - oldContent, err = filer.ReadInsideFiler(client, filer.DirectoryEtcRemote, filer.REMOTE_STORAGE_MOUNT_FILE) - return err - }) - if err != nil { - if err != filer_pb.ErrNotFound { - return fmt.Errorf("read existing mapping: %v", err) - } - } - - mappings, unmarshalErr := filer.UnmarshalRemoteStorageMappings(oldContent) - if unmarshalErr != nil { - return unmarshalErr + mappings, readErr := remote_storage.ReadMountMappings(commandEnv.option.GrpcDialOption, commandEnv.option.FilerAddress) + if readErr != nil { + return readErr } m := jsonpb.Marshaler{ |
