mirror of
https://github.com/rancher/rke.git
synced 2025-05-07 15:57:06 +00:00
gosimple code
This commit is contained in:
parent
bd969be49d
commit
1cb850d7cf
@ -30,15 +30,15 @@ func CanReadCertAndKey(certPath, keyPath string) (bool, error) {
|
|||||||
certReadable := canReadFile(certPath)
|
certReadable := canReadFile(certPath)
|
||||||
keyReadable := canReadFile(keyPath)
|
keyReadable := canReadFile(keyPath)
|
||||||
|
|
||||||
if certReadable == false && keyReadable == false {
|
if !certReadable && !keyReadable {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if certReadable == false {
|
if !certReadable {
|
||||||
return false, fmt.Errorf("error reading %s, certificate and key must be supplied as a pair", certPath)
|
return false, fmt.Errorf("error reading %s, certificate and key must be supplied as a pair", certPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
if keyReadable == false {
|
if !keyReadable {
|
||||||
return false, fmt.Errorf("error reading %s, certificate and key must be supplied as a pair", keyPath)
|
return false, fmt.Errorf("error reading %s, certificate and key must be supplied as a pair", keyPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user