config: Do not migrate config file if not needed. (#4264)

Also improve the error message returned by `pkg/quick`.

Fixes #4233
This commit is contained in:
Harshavardhana
2017-05-06 10:16:59 -07:00
committed by GitHub
parent 2df1e2e9a9
commit 610dbe3479
7 changed files with 214 additions and 91 deletions

View File

@@ -107,7 +107,7 @@ func initConfig() {
// Config file does not exist, we create it fresh and return upon success.
if isFile(getConfigFile()) {
fatalIf(migrateConfig(), "Config migration failed.")
fatalIf(loadConfig(), "Unable to load minio config file")
fatalIf(loadConfig(), "Unable to load config version: '%s'.", v18)
} else {
fatalIf(newConfig(), "Unable to initialize minio config for the first time.")
log.Println("Created minio configuration file successfully at " + getConfigDir())