aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_remote_mount.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-04 14:56:13 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-04 14:56:13 -0700
commitb9ecf1e3a8685c62ccac80ed0fbc180ed34b48e2 (patch)
treeb0368383e4da623b4eac1fc3c10a0bf35d52568f /weed/shell/command_remote_mount.go
parentd84c31169922d395074b1b256d05aa638462df50 (diff)
downloadseaweedfs-b9ecf1e3a8685c62ccac80ed0fbc180ed34b48e2.tar.xz
seaweedfs-b9ecf1e3a8685c62ccac80ed0fbc180ed34b48e2.zip
refacotring
Diffstat (limited to 'weed/shell/command_remote_mount.go')
-rw-r--r--weed/shell/command_remote_mount.go19
1 files changed, 1 insertions, 18 deletions
diff --git a/weed/shell/command_remote_mount.go b/weed/shell/command_remote_mount.go
index 5cd69f3b0..35aad9498 100644
--- a/weed/shell/command_remote_mount.go
+++ b/weed/shell/command_remote_mount.go
@@ -95,25 +95,8 @@ func (c *commandRemoteMount) listExistingRemoteStorageMounts(commandEnv *Command
func (c *commandRemoteMount) findRemoteStorageConfiguration(commandEnv *CommandEnv, writer io.Writer, remote *filer_pb.RemoteStorageLocation) (conf *filer_pb.RemoteConf, err error) {
- // read storage configuration data
- var confBytes []byte
- err = commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
- confBytes, err = filer.ReadInsideFiler(client, filer.DirectoryEtcRemote, remote.Name+filer.REMOTE_STORAGE_CONF_SUFFIX)
- return err
- })
- if err != nil {
- err = fmt.Errorf("no remote storage configuration for %s : %v", remote.Name, err)
- return
- }
-
- // unmarshal storage configuration
- conf = &filer_pb.RemoteConf{}
- if unMarshalErr := proto.Unmarshal(confBytes, conf); unMarshalErr != nil {
- err = fmt.Errorf("unmarshal %s/%s: %v", filer.DirectoryEtcRemote, remote.Name, unMarshalErr)
- return
- }
+ return remote_storage.ReadRemoteStorageConf(commandEnv.option.GrpcDialOption, commandEnv.option.FilerAddress, remote.Name)
- return
}
func (c *commandRemoteMount) pullMetadata(commandEnv *CommandEnv, writer io.Writer, dir string, nonEmpty bool, remoteConf *filer_pb.RemoteConf, remote *filer_pb.RemoteStorageLocation) error {