diff options
author | Joshua Justice <jjustice6@bloomberg.net> | 2019-06-04 12:03:52 -0400 |
---|---|---|
committer | Joshua Justice <jjustice6@bloomberg.net> | 2019-07-10 15:28:38 -0400 |
commit | 510cd478e3862e19be299dd3c743fbcca9a8719b (patch) | |
tree | 49ee6dc17c5060552638e522de4b73d50ad12b3c /lib | |
parent | 0736be5bfe26792d48d3905144920cd28899da82 (diff) | |
download | ohai-510cd478e3862e19be299dd3c743fbcca9a8719b.tar.gz |
Clean up array initialization
Signed-off-by: Joshua Justice <jjustice6@bloomberg.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ohai/plugins/packages.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ohai/plugins/packages.rb b/lib/ohai/plugins/packages.rb index a7a74f7d..7f13dd32 100644 --- a/lib/ohai/plugins/packages.rb +++ b/lib/ohai/plugins/packages.rb @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Author:: "Christian Höltje" <choltje@us.ibm.com> # Author:: "Christopher M. Luciano" <cmlucian@us.ibm.com> # Author:: Shahul Khajamohideen (<skhajamohid1@bloomberg.net>) @@ -53,7 +54,7 @@ Ohai.plugin(:Packages) do # Create an "other_versions" array for tracking all versions of packages with this name. # The top-level package information will be the first one returned by rpm -qa, # all others go in this list, with the same information they'd normally have. - packages[name]["other_versions"] = [] unless packages[name]["other_versions"] + packages[name]["other_versions"] ||= [] packages[name]["other_versions"] << Mash.new({ "epoch" => epoch, "version" => version, "release" => release, "installdate" => installdate, "arch" => arch }) else packages[name] = { "epoch" => epoch, "version" => version, "release" => release, "installdate" => installdate, "arch" => arch } |