diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-12-06 23:16:20 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-12-06 23:16:20 -0800 |
| commit | 01e2da5782f7fb14fb4ba1350e0c1fa097557dcf (patch) | |
| tree | 102f66a8b15a1eb56df36df77f9cf14e6ccd5657 /weed/shell/command_fs_configure.go | |
| parent | 77286f8bea1389aa17555f0b3dc244b07b938643 (diff) | |
| download | seaweedfs-01e2da5782f7fb14fb4ba1350e0c1fa097557dcf.tar.xz seaweedfs-01e2da5782f7fb14fb4ba1350e0c1fa097557dcf.zip | |
refactoring
Diffstat (limited to 'weed/shell/command_fs_configure.go')
| -rw-r--r-- | weed/shell/command_fs_configure.go | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/weed/shell/command_fs_configure.go b/weed/shell/command_fs_configure.go index b67a6e672..565e6c66e 100644 --- a/weed/shell/command_fs_configure.go +++ b/weed/shell/command_fs_configure.go @@ -5,13 +5,11 @@ import ( "flag" "fmt" "io" - "net/http" "strings" "github.com/chrislusf/seaweedfs/weed/filer" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/storage/super_block" - "github.com/chrislusf/seaweedfs/weed/util" ) func init() { @@ -118,21 +116,9 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io if *apply { - target := fmt.Sprintf("http://%s:%d%s/%s", commandEnv.option.FilerHost, commandEnv.option.FilerPort, filer.DirectoryEtc, filer.FilerConfName) - - // set the HTTP method, url, and request body - req, err := http.NewRequest(http.MethodPut, target, &buf) - if err != nil { - return err - } - - // set the request header Content-Type for json - req.Header.Set("Content-Type", "text/plain; charset=utf-8") - resp, err := http.DefaultClient.Do(req) - if err != nil { + if err := filer.SaveAs(commandEnv.option.FilerHost, int(commandEnv.option.FilerPort), filer.DirectoryEtc, filer.FilerConfName, "text/plain; charset=utf-8", &buf); err != nil { return err } - util.CloseResponse(resp) } |
