diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-09-04 04:53:36 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-09-04 04:53:36 -0700 |
| commit | 63c84584bb045d10c5ba7b3eea5f6d8936edb42f (patch) | |
| tree | a10508723f6f4ba6fe3ceef2ec8ae949398a0934 /weed/shell/command_remote_mount.go | |
| parent | 4b28c5f6c33f0dd0eed07ad24936b30f76b8d449 (diff) | |
| download | seaweedfs-63c84584bb045d10c5ba7b3eea5f6d8936edb42f.tar.xz seaweedfs-63c84584bb045d10c5ba7b3eea5f6d8936edb42f.zip | |
refactor
Diffstat (limited to 'weed/shell/command_remote_mount.go')
| -rw-r--r-- | weed/shell/command_remote_mount.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/shell/command_remote_mount.go b/weed/shell/command_remote_mount.go index 8ac30f70d..6a292e3aa 100644 --- a/weed/shell/command_remote_mount.go +++ b/weed/shell/command_remote_mount.go @@ -79,7 +79,7 @@ func (c *commandRemoteMount) Do(args []string, commandEnv *CommandEnv, writer io } // store a mount configuration in filer - if err = c.saveMountMapping(commandEnv, writer, *dir, remoteStorageLocation); err != nil { + if err = c.saveMountMapping(commandEnv, *dir, remoteStorageLocation); err != nil { return fmt.Errorf("save mount mapping: %v", err) } @@ -177,11 +177,11 @@ func (c *commandRemoteMount) syncMetadata(commandEnv *CommandEnv, writer io.Writ return nil } -func (c *commandRemoteMount) saveMountMapping(commandEnv *CommandEnv, writer io.Writer, dir string, remoteStorageLocation *remote_pb.RemoteStorageLocation) (err error) { +func (c *commandRemoteMount) saveMountMapping(filerClient filer_pb.FilerClient, dir string, remoteStorageLocation *remote_pb.RemoteStorageLocation) (err error) { // read current mapping var oldContent, newContent []byte - err = commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { + err = filerClient.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { oldContent, err = filer.ReadInsideFiler(client, filer.DirectoryEtcRemote, filer.REMOTE_STORAGE_MOUNT_FILE) return err }) @@ -198,7 +198,7 @@ func (c *commandRemoteMount) saveMountMapping(commandEnv *CommandEnv, writer io. } // save back - err = commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { + err = filerClient.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { return filer.SaveInsideFiler(client, filer.DirectoryEtcRemote, filer.REMOTE_STORAGE_MOUNT_FILE, newContent) }) if err != nil { |
