diff options
| author | bingoohuang <bingoo.huang@gmail.com> | 2021-07-12 13:47:42 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-12 13:47:42 +0800 |
| commit | 272c7836c3a97c0ab8b31e335d7fa6efc769edc0 (patch) | |
| tree | b17792c1a77e0c2fdd07b371da64ca5a14a62f75 /weed/shell | |
| parent | ed57a55eaec2318bf21693582105660d7612118b (diff) | |
| parent | d013d6d9680296ba13c3f0da09f3bb3ae8550828 (diff) | |
| download | seaweedfs-272c7836c3a97c0ab8b31e335d7fa6efc769edc0.tar.xz seaweedfs-272c7836c3a97c0ab8b31e335d7fa6efc769edc0.zip | |
Merge pull request #1 from chrislusf/master
Diffstat (limited to 'weed/shell')
| -rw-r--r-- | weed/shell/command_fs_configure.go | 4 | ||||
| -rw-r--r-- | weed/shell/command_s3_configure.go | 2 | ||||
| -rw-r--r-- | weed/shell/command_volume_fsck.go | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/weed/shell/command_fs_configure.go b/weed/shell/command_fs_configure.go index 52fcae1c6..a7e601bec 100644 --- a/weed/shell/command_fs_configure.go +++ b/weed/shell/command_fs_configure.go @@ -120,7 +120,9 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io if *apply { - if err := filer.SaveAs(commandEnv.option.FilerHost, int(commandEnv.option.FilerPort), filer.DirectoryEtcSeaweedFS, filer.FilerConfName, "text/plain; charset=utf-8", &buf); err != nil { + if err = commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { + return filer.SaveInsideFiler(client, filer.DirectoryEtcSeaweedFS, filer.FilerConfName, buf.Bytes()) + }); err != nil && err != filer_pb.ErrNotFound { return err } diff --git a/weed/shell/command_s3_configure.go b/weed/shell/command_s3_configure.go index ca51ef72f..5eab2ebd0 100644 --- a/weed/shell/command_s3_configure.go +++ b/weed/shell/command_s3_configure.go @@ -164,7 +164,7 @@ func (c *commandS3Configure) Do(args []string, commandEnv *CommandEnv, writer io } buf.Reset() - filer.S3ConfigurationToText(&buf, s3cfg) + filer.ProtoToText(&buf, s3cfg) fmt.Fprintf(writer, string(buf.Bytes())) fmt.Fprintln(writer) diff --git a/weed/shell/command_volume_fsck.go b/weed/shell/command_volume_fsck.go index 64389fdb5..0b40cfb7c 100644 --- a/weed/shell/command_volume_fsck.go +++ b/weed/shell/command_volume_fsck.go @@ -206,7 +206,7 @@ func (c *commandVolumeFsck) findExtraChunksInVolumeServers(volumeIdToVInfo map[u if verbose { for _, fid := range orphanFileIds { - fmt.Fprintf(writer, "%sxxxxxxxx\n", fid) + fmt.Fprintf(writer, "%s\n", fid) } } @@ -410,7 +410,7 @@ func (c *commandVolumeFsck) oneVolumeFileIdsSubtractFilerFileIds(tempFolder stri var orphanFileCount uint64 db.AscendingVisit(func(n needle_map.NeedleValue) error { // fmt.Printf("%d,%x\n", volumeId, n.Key) - orphanFileIds = append(orphanFileIds, fmt.Sprintf("%d,%s", volumeId, n.Key.String())) + orphanFileIds = append(orphanFileIds, fmt.Sprintf("%d,%s00000000", volumeId, n.Key.String())) orphanFileCount++ orphanDataSize += uint64(n.Size) return nil |
