Make sshproxy use a hostmount on master PD (don't spam sshKeys on upgrade/reboot).

Add comment describing what SSHTunnelList.Close() does.
Simplify util.FileExists.
This commit is contained in:
CJ Cullen
2015-06-05 14:49:26 -07:00
parent cb317604ab
commit 04cd9b3c75
4 changed files with 17 additions and 14 deletions

View File

@@ -515,16 +515,13 @@ func ShortenString(str string, n int) string {
} else {
return str[:n]
}
}
func FileExists(filename string) (bool, error) {
file, err := os.Open(filename)
defer file.Close()
if err != nil {
if os.IsNotExist(err) {
return false, nil
} else {
return false, err
}
if _, err := os.Stat(filename); os.IsNotExist(err) {
return false, nil
} else if err != nil {
return false, err
}
return true, nil
}