()
| 632 | } |
| 633 | |
| 634 | func IsP11KitClientPresent() (bool, error) { |
| 635 | var p11KitClientPaths []string |
| 636 | var supportedDistro bool |
| 637 | |
| 638 | hostID, err := getHostID() |
| 639 | if err == nil { |
| 640 | distroObj, ok := supportedDistros[hostID] |
| 641 | supportedDistro = ok |
| 642 | if supportedDistro { |
| 643 | p11KitClientPaths = distroObj.GetP11KitClientPaths() |
| 644 | } |
| 645 | } |
| 646 | |
| 647 | if !supportedDistro { |
| 648 | if err == nil { |
| 649 | err = fmt.Errorf("failed to find %s in the list of supported distributions", hostID) |
| 650 | } |
| 651 | |
| 652 | for _, distroObj := range supportedDistros { |
| 653 | paths := distroObj.GetP11KitClientPaths() |
| 654 | p11KitClientPaths = append(p11KitClientPaths, paths...) |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | for _, path := range p11KitClientPaths { |
| 659 | if PathExists(path) { |
| 660 | return true, err |
| 661 | } |
| 662 | } |
| 663 | |
| 664 | return false, err |
| 665 | } |
| 666 | |
| 667 | func SetUpConfiguration() error { |
| 668 | logrus.Debug("Setting up configuration") |
nothing calls this directly
no test coverage detected
searching dependent graphs…