aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/machine_info_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/host/machine_info_linux.go')
-rw-r--r--pkg/host/machine_info_linux.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/host/machine_info_linux.go b/pkg/host/machine_info_linux.go
index 317d34cd9..3b0971495 100644
--- a/pkg/host/machine_info_linux.go
+++ b/pkg/host/machine_info_linux.go
@@ -21,6 +21,7 @@ func init() {
{"KVM", readKVMInfo},
}
machineModulesInfo = getModulesInfo
+ machineGlobsInfo = getGlobsInfo
}
func readCPUInfo(buffer *bytes.Buffer) error {
@@ -140,3 +141,16 @@ func getModulesInfo() ([]KernelModule, error) {
}
return modules, nil
}
+
+func getGlobsInfo(globs []string) (map[string][]string, error) {
+ files := make(map[string][]string, len(globs))
+ for _, glob := range globs {
+ matches, err := filepath.Glob(glob)
+ if err != nil {
+ return nil, err
+ }
+ files[glob] = matches
+ }
+
+ return files, nil
+}