Skip to content

Commit

Permalink
Add platform_backend attribute for Target Mode (#1824)
Browse files Browse the repository at this point in the history
* Add platform_backend attribute for Target Mode


---------

Signed-off-by: Thomas Heinen <[email protected]>
  • Loading branch information
thheinen authored Jun 25, 2024
1 parent 89c59d1 commit dfe0fef
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/ohai/plugins/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,24 @@
#

Ohai.plugin(:Platform) do
provides "platform", "platform_version", "platform_family"
provides "platform", "platform_version", "platform_family", "platform_backend"
depends "os", "os_version"

collect_data(:default) do
platform os unless attribute?("platform")
platform_version os_version unless attribute?("platform_version")
platform_family platform unless attribute?("platform_family")

platform_backend Mash.new
platform_backend["type"] = "local"
platform_backend["uri"] = "local://"

if connection
platform_backend["type"] = connection.backend_type
if connection.respond_to?(:uri)
platform_backend["type"] = connection.uri.split(":").first
platform_backend["uri"] = connection.uri
end
end
end
end

0 comments on commit dfe0fef

Please sign in to comment.