Rename config.json in config-dir with '.deprecated' extension (#6446)

Fixes #6444
This commit is contained in:
Harshavardhana
2018-09-10 16:15:47 -07:00
committed by Dee Koder
parent 5c0b98abf0
commit 12b4971b70
2 changed files with 21 additions and 6 deletions

View File

@@ -265,6 +265,12 @@ func serverMain(ctx *cli.Context) {
globalActiveCred = config.Credential
}
if os.IsNotExist(err) {
if _, err = Load(getConfigFile()+".deprecated", config); err == nil {
globalActiveCred = config.Credential
}
}
if globalActiveCred.IsValid() {
// Credential is valid don't throw an error instead print a message regarding deprecation of 'config.json'
// based model and proceed to use it for now in distributed setup.