From b77ee44b511330a7bc00f4626d49bad2a8948786 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem <4048546+olehermanse@users.noreply.github.com> Date: Wed, 28 Feb 2024 13:17:11 +0100 Subject: [PATCH] When failing to detect platform, inventory attribute "OS" now defaults to PRETTY_NAME from os-release as a fallback This is only a fallback / last resort, in the case where the C code puts "Unknown" into the sys.os_name_human variable. Ticket: CFE-4342 --- inventory/os.cf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inventory/os.cf b/inventory/os.cf index e1f6537461..a56fe41d28 100644 --- a/inventory/os.cf +++ b/inventory/os.cf @@ -130,5 +130,14 @@ amzn_2:: string => "Amazon 2", meta => { "inventory", "attribute_name=OS" }; +any:: + "description" + string => "$(sys.os_release[PRETTY_NAME])", + if => and( + strcmp("$(sys.os_name_human)", "Unknown"), + isvariable("sys.os_release[PRETTY_NAME])"), + ), + meta => { "inventory", "attribute_name=OS", "derived-from=sys.os_release" }; + @endif }