MCPcopy
hub / github.com/containers/toolbox / IsP11KitClientPresent

Function IsP11KitClientPresent

src/pkg/utils/utils.go:634–665  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

632}
633
634func 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
667func SetUpConfiguration() error {
668 logrus.Debug("Setting up configuration")

Callers

nothing calls this directly

Calls 2

getHostIDFunction · 0.85
PathExistsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…