server: save and compare multiple disks are used (#1474)

When server is run with multiple disks which uses xl interface where
order and count of disks are important, this patch saves such disks
configuration and compares in next run if there is a mismatch.

Fixes #1458
This commit is contained in:
Bala FA
2016-05-05 00:48:20 +05:30
committed by Harshavardhana
parent e4d89d8156
commit da3a53376c
4 changed files with 163 additions and 6 deletions

View File

@@ -86,3 +86,26 @@ func getConfigFile() (string, error) {
}
return filepath.Join(configPath, globalMinioConfigFile), nil
}
// isFormatConfigFileExists - returns true if format config file exists.
func isFormatConfigFileExists() bool {
st, err := os.Stat(mustGetFormatConfigFile())
return (err == nil && st.Mode().IsRegular())
}
// mustGetFormatConfigFile must get format config file.
func mustGetFormatConfigFile() string {
configFile, err := getFormatConfigFile()
fatalIf(err, "Unable to get format config file.", nil)
return configFile
}
// getFormatConfigFile get format config file.
func getFormatConfigFile() (string, error) {
configPath, err := getConfigPath()
if err != nil {
return "", err
}
return filepath.Join(configPath, globalMinioFormatConfigFile), nil
}