summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-11-06 17:42:23 -0800
committerGitHub <noreply@github.com>2020-11-06 17:42:23 -0800
commit2208e36b25a622e0fe5a04a52a7dba5abbbbaa56 (patch)
tree0e2a4e72107581820e2184df226c479d10218200
parent4b865541b6142f0c9f01d802cfe19c774ef23389 (diff)
downloadohai-2208e36b25a622e0fe5a04a52a7dba5abbbbaa56.tar.gz
Update lib/ohai/plugins/linux/hostnamectl.rb
TIL you can limit the split. Thanks @ziggythehamster Signed-off-by: Tim Smith <tsmith@chef.io> Co-authored-by: Keith Gable <ziggy@ignition-project.com>
-rw-r--r--lib/ohai/plugins/linux/hostnamectl.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ohai/plugins/linux/hostnamectl.rb b/lib/ohai/plugins/linux/hostnamectl.rb
index b117963f..0c74abcd 100644
--- a/lib/ohai/plugins/linux/hostnamectl.rb
+++ b/lib/ohai/plugins/linux/hostnamectl.rb
@@ -26,7 +26,7 @@ Ohai.plugin(:Hostnamectl) do
hostnamectl_path = which("hostnamectl")
if hostnamectl_path
shell_out(hostnamectl_path).stdout.split("\n").each do |line|
- key, val = line.split(": ")
+ key, val = line.split(": ", 2)
hostnamectl[key.chomp.lstrip.tr(" ", "_").downcase] = val.chomp
end
end