diff options
author | Tim Smith <tsmith@chef.io> | 2020-11-06 17:42:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 17:42:23 -0800 |
commit | 2208e36b25a622e0fe5a04a52a7dba5abbbbaa56 (patch) | |
tree | 0e2a4e72107581820e2184df226c479d10218200 | |
parent | 4b865541b6142f0c9f01d802cfe19c774ef23389 (diff) | |
download | ohai-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.rb | 2 |
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 |