Update the builtin keys; move catalog to core; protect against unset plugin directory

This commit is contained in:
Brian Kassouf
2017-04-24 10:30:33 -07:00
parent 3ceb7b69e1
commit f4ef3df4bd
7 changed files with 47 additions and 62 deletions

View File

@@ -8,7 +8,6 @@ import (
"net/url"
"os"
"os/signal"
"path/filepath"
"runtime"
"sort"
"strconv"
@@ -21,7 +20,6 @@ import (
colorable "github.com/mattn/go-colorable"
log "github.com/mgutz/logxi/v1"
homedir "github.com/mitchellh/go-homedir"
"google.golang.org/grpc/grpclog"
@@ -245,23 +243,6 @@ func (c *ServerCommand) Run(args []string) int {
coreConfig.DevToken = devRootTokenID
}
if config.PluginDirectory == "" {
homePath, err := homedir.Dir()
if err != nil {
c.Ui.Output(fmt.Sprintf(
"Error getting user's home directory: %v", err))
return 1
}
coreConfig.PluginDirectory = filepath.Join(homePath, "/.vault-plugins/")
err = os.Mkdir(coreConfig.PluginDirectory, 0700)
if err != nil && !os.IsExist(err) {
c.Ui.Output(fmt.Sprintf(
"Error making default plugin directory: %v", err))
return 1
}
}
var disableClustering bool
// Initialize the separate HA storage backend, if it exists