Remove unused commented code
This commit is contained in:
@@ -23,22 +23,10 @@ import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
//const mainDir string := "/mnt/mqm"
|
||||
const mqmUID uint32 = 999
|
||||
const mqmGID uint32 = 999
|
||||
|
||||
func createVolume(path string) error {
|
||||
// fi, err := os.Stat(path)
|
||||
// if err != nil {
|
||||
// if os.IsNotExist(err) {
|
||||
// // TODO: Should this be fatal?
|
||||
// //log.Warnf("No volume found under %v", path)
|
||||
// return nil
|
||||
// } else {
|
||||
// return err
|
||||
// }
|
||||
// }
|
||||
//log.Printf("%v details: %v", path, fi.Sys())
|
||||
dataPath := filepath.Join(path, "data")
|
||||
fi, err := os.Stat(dataPath)
|
||||
if err != nil {
|
||||
@@ -57,8 +45,6 @@ func createVolume(path string) error {
|
||||
}
|
||||
sys := fi.Sys()
|
||||
if sys != nil && runtime.GOOS == "linux" {
|
||||
// log.Printf("Checking UID/GID for %v", dataPath)
|
||||
//log.Debugf("Checking UID/GID for %v", dataPath)
|
||||
stat := sys.(*syscall.Stat_t)
|
||||
if stat.Uid != mqmUID || stat.Gid != mqmGID {
|
||||
err = os.Chown(dataPath, int(mqmUID), int(mqmGID))
|
||||
@@ -70,18 +56,3 @@ func createVolume(path string) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// If /mnt/mqm exists
|
||||
// If /mnt/mqm contains a "data" directory AND data is owned by mqm:mqm AND data is writeable by mqm:mqm then
|
||||
// Create Symlink from /var/mqm to /mnt/mqm/data
|
||||
// Else
|
||||
// // Try to sort it out
|
||||
// Create directory /mnt/mqm/data
|
||||
// If directory not already owned by mqm:mqm
|
||||
// chown mqm:mqm
|
||||
// if error
|
||||
// delete directory again if empty
|
||||
// if directory not already 0755
|
||||
// chmod 0755
|
||||
// if error
|
||||
// delete directory again if empty
|
||||
|
||||
Reference in New Issue
Block a user