forked from TrueCloudLab/certificates
[logger map] small optimization
Rather than doing two key writes and one lookup, just write once.
This commit is contained in:
parent
55bf5a4526
commit
8e3481a8ef
1 changed files with 3 additions and 2 deletions
|
@ -414,9 +414,10 @@ func LogCertificate(w http.ResponseWriter, cert *x509.Certificate) {
|
|||
if err != nil || len(rest) > 0 {
|
||||
break
|
||||
}
|
||||
m["provisioner"] = fmt.Sprintf("%s", val.Name)
|
||||
if len(val.CredentialID) > 0 {
|
||||
m["provisioner"] = fmt.Sprintf("%s (%s)", m["provisioner"], val.CredentialID)
|
||||
m["provisioner"] = fmt.Sprintf("%s (%s)", val.Name, val.CredentialID)
|
||||
} else {
|
||||
m["provisioner"] = fmt.Sprintf("%s", val.Name)
|
||||
}
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue