diff options
Diffstat (limited to 'weed/shell')
| -rw-r--r-- | weed/shell/command_remote_configure.go | 8 | ||||
| -rw-r--r-- | weed/shell/command_remote_mount.go | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/weed/shell/command_remote_configure.go b/weed/shell/command_remote_configure.go index 567143ce1..20ded5f5b 100644 --- a/weed/shell/command_remote_configure.go +++ b/weed/shell/command_remote_configure.go @@ -10,6 +10,7 @@ import ( "github.com/golang/protobuf/proto" "io" "regexp" + "strings" ) func init() { @@ -84,6 +85,9 @@ func (c *commandRemoteConfigure) listExistingRemoteStorages(commandEnv *CommandE fmt.Fprintf(writer, "skipping %s\n", entry.Name) return nil } + if !strings.HasSuffix(entry.Name, filer.REMOTE_STORAGE_CONF_SUFFIX) { + return nil + } conf := &filer_pb.RemoteConf{} if err := proto.Unmarshal(entry.Content, conf); err != nil { @@ -105,7 +109,7 @@ func (c *commandRemoteConfigure) deleteRemoteStorage(commandEnv *CommandEnv, wri request := &filer_pb.DeleteEntryRequest{ Directory: filer.DirectoryEtcRemote, - Name: storageName, + Name: storageName + filer.REMOTE_STORAGE_CONF_SUFFIX, IgnoreRecursiveError: false, IsDeleteData: true, IsRecursive: true, @@ -132,7 +136,7 @@ func (c *commandRemoteConfigure) saveRemoteStorage(commandEnv *CommandEnv, write } if err = commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { - return filer.SaveInsideFiler(client, filer.DirectoryEtcRemote, conf.Name, data) + return filer.SaveInsideFiler(client, filer.DirectoryEtcRemote, conf.Name+filer.REMOTE_STORAGE_CONF_SUFFIX, data) }); err != nil && err != filer_pb.ErrNotFound { return err } diff --git a/weed/shell/command_remote_mount.go b/weed/shell/command_remote_mount.go index 22d92ef8b..10541092a 100644 --- a/weed/shell/command_remote_mount.go +++ b/weed/shell/command_remote_mount.go @@ -7,7 +7,6 @@ import ( "github.com/chrislusf/seaweedfs/weed/filer" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/remote_storage" - _ "github.com/chrislusf/seaweedfs/weed/remote_storage/s3" "github.com/chrislusf/seaweedfs/weed/util" "github.com/golang/protobuf/proto" "io" @@ -82,7 +81,7 @@ func (c *commandRemoteMount) findRemoteStorageConfiguration(commandEnv *CommandE // read storage configuration data var confBytes []byte err = commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { - confBytes, err = filer.ReadInsideFiler(client, filer.DirectoryEtcRemote, storageName) + confBytes, err = filer.ReadInsideFiler(client, filer.DirectoryEtcRemote, storageName+filer.REMOTE_STORAGE_CONF_SUFFIX) return err }) if err != nil { |
