mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-26 22:01:09 +01:00
feature/tpm: quiet log output a bit
I was debugging a customer issue and saw in their 1.88.3 logs:
TPM: error opening: stat /dev/tpm0: no such file or directory
That's unnecessary output. The lack of TPM will be reported by
them having a nil Hostinfo.TPM, which is plenty elsewhere in logs.
Let's only write out an "error opening" line if it's an interesting
error. (perhaps permissions, or EIO, etc)
Updates #cleanup
Change-Id: I3f987f6bf1d3ada03473ca3eef555e9cfafc7677
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
005e264b54
commit
1a93a8a704
@ -73,10 +73,16 @@ func info() *tailcfg.TPMInfo {
|
||||
|
||||
tpm, err := open()
|
||||
if err != nil {
|
||||
logf("error opening: %v", err)
|
||||
if !os.IsNotExist(err) || verboseTPM() {
|
||||
// Only log if it's an interesting error, not just "no TPM",
|
||||
// as is very common, especially in VMs.
|
||||
logf("error opening: %v", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
logf("successfully opened")
|
||||
if verboseTPM() {
|
||||
logf("successfully opened")
|
||||
}
|
||||
defer tpm.Close()
|
||||
|
||||
info := new(tailcfg.TPMInfo)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user