diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-08-09 19:40:49 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-08-09 19:40:49 -0700 |
commit | e16263f08a26e736ed05afa6049c1a49f864da2f (patch) | |
tree | dca2910ed3730c8f9242b67685b55746d3e3a651 | |
parent | 536609e5def373e81116fe7aa92fea6548669d6e (diff) | |
download | ohai-e16263f08a26e736ed05afa6049c1a49f864da2f.tar.gz |
Avoid setting the mid value to nil and then setting it again
Just fall back to nil with an else
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/ohai/plugins/linux/machineid.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ohai/plugins/linux/machineid.rb b/lib/ohai/plugins/linux/machineid.rb index 56b22227..565bfde1 100644 --- a/lib/ohai/plugins/linux/machineid.rb +++ b/lib/ohai/plugins/linux/machineid.rb @@ -20,12 +20,12 @@ Ohai.plugin(:Machineid) do provides "machine_id" collect_data(:linux) do - mid = nil - if ::File.exist?("/etc/machine-id") mid = ::File.read("/etc/machine-id").chomp elsif ::File.exist?("/var/lib/dbus/machine-id") mid = ::File.read("/var/lib/dbus/machine-id").chomp + else + mid = nil end if mid |