Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions inventory/any.cf
Original file line number Diff line number Diff line change
Expand Up @@ -1167,9 +1167,17 @@ bundle agent cfe_autorun_inventory_dmidecode
"dmi[$(dmivars)]"
unless => isvariable("dmi[$(dmivars)]"),
# This is just for system-uuid really, which we get from the awk script above by preference.
@if minimum_version(3.22.0)
Comment thread
larsewi marked this conversation as resolved.
Resolved
# Some files (e.g. product_serial) are only readable by root.
# The isreadable() was introduced in CFEngine 3.22.
if => isreadable(
"/sys/devices/virtual/dmi/id/$(sysfs_name_for[$(dmivars)])", 1
),
@else
if => fileexists(
"/sys/devices/virtual/dmi/id/$(sysfs_name_for[$(dmivars)])"
),
@endif
string => readfile(
"/sys/devices/virtual/dmi/id/$(sysfs_name_for[$(dmivars)])", 0
),
Expand Down
Loading