rewrite minio runtime checks

This commit is contained in:
Anand Babu (AB) Periasamy
2016-02-15 17:56:56 +05:30
parent e73301944a
commit bbca70e13b
21 changed files with 1574 additions and 202 deletions

View File

@@ -17,9 +17,9 @@
package xl
import (
"os/user"
"path/filepath"
"github.com/minio/go-homedir"
"github.com/minio/minio/pkg/probe"
"github.com/minio/minio/pkg/quick"
)
@@ -29,11 +29,11 @@ func getXLConfigPath() (string, *probe.Error) {
if customConfigPath != "" {
return customConfigPath, nil
}
u, err := user.Current()
homeDir, err := homedir.Dir()
if err != nil {
return "", probe.NewError(err)
}
xlConfigPath := filepath.Join(u.HomeDir, ".minio", "xl.json")
xlConfigPath := filepath.Join(homeDir, ".minio", "xl.json")
return xlConfigPath, nil
}