mirror of
https://gerrit.hackerspace.pl/hscloud
synced 2025-01-24 16:33:54 +00:00
go/pki: fix error return
DeveloperCredentialsLocation used to glog.Exitf instead of returning an error, and a consumer (prodaccess) used to not check the return code. Bad refactor? Change-Id: I6c2d05966ba6b3eb300c24a51584ccf5e324cd49
This commit is contained in:
parent
6751d826f1
commit
bade46d45f
2 changed files with 4 additions and 1 deletions
|
@ -12,6 +12,9 @@ import (
|
|||
|
||||
func useHSPKIKeys(keys *pb.HSPKIKeys) {
|
||||
path, err := pki.DeveloperCredentialsLocation()
|
||||
if err != nil {
|
||||
glog.Exitf("Could not get location of HSPKI creds: %v", err)
|
||||
}
|
||||
err = os.MkdirAll(path, 0700)
|
||||
if err != nil {
|
||||
glog.Exitf("mkdir %q: %v", path, err)
|
||||
|
|
|
@ -16,7 +16,7 @@ import (
|
|||
func DeveloperCredentialsLocation() (string, error) {
|
||||
cfgDir, err := os.UserConfigDir()
|
||||
if err != nil {
|
||||
glog.Exitf("UserConfigDir: %w", err)
|
||||
return "", fmt.Errorf("UserConfigDir: %w", err)
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s/hspki", cfgDir), nil
|
||||
|
|
Loading…
Reference in a new issue