diff --git a/lib/facter/resolvers/aix/disks.rb b/lib/facter/resolvers/aix/disks.rb index b19ffbcb23..bd55436fbe 100644 --- a/lib/facter/resolvers/aix/disks.rb +++ b/lib/facter/resolvers/aix/disks.rb @@ -47,7 +47,7 @@ def find_size(name) end def compute_size(size_hash) - physical_partitions = size_hash['TOTAL PPs'].to_i + size_hash['FREE PPs'].to_i + physical_partitions = size_hash['TOTAL PPs'].to_i size_physical_partition = size_hash['PP SIZE'] exp = if size_physical_partition[/mega/] Facter::Util::Aix::InfoExtractor::MEGABYTES_EXPONENT diff --git a/lib/facter/resolvers/aix/partitions.rb b/lib/facter/resolvers/aix/partitions.rb index 2344f97a3e..bd1d854ca4 100644 --- a/lib/facter/resolvers/aix/partitions.rb +++ b/lib/facter/resolvers/aix/partitions.rb @@ -56,14 +56,14 @@ def populate_from_lslv(name) end def compute_size(info_hash) - physical_partitions = info_hash['PPs'].to_i + logical_partitions = info_hash['LPs'].to_i size_physical_partition = info_hash['PP SIZE'] exp = if size_physical_partition[/mega/] Facter::Util::Aix::InfoExtractor::MEGABYTES_EXPONENT else Facter::Util::Aix::InfoExtractor::GIGABYTES_EXPONENT end - size_physical_partition.to_i * physical_partitions * exp + size_physical_partition.to_i * logical_partitions * exp end end end diff --git a/lib/facter/util/aix/info_extractor.rb b/lib/facter/util/aix/info_extractor.rb index 9944571b7b..939919b4c3 100644 --- a/lib/facter/util/aix/info_extractor.rb +++ b/lib/facter/util/aix/info_extractor.rb @@ -61,7 +61,7 @@ def self.extract(content, cmd) properties = PROPERTIES[cmd] properties.each do |property| str = (properties - [property]).join('|') - matcher = content.match(/#{Regexp.escape(property)}([^\n]*?)(#{str}|\n|$)/s) + matcher = content.match(/(?:^|^[^:]+:[^:]+)#{Regexp.escape(property)}([^\n]*?)(#{str}|\n|$)/s) if matcher value = matcher[1].strip property_hash[property.split(':').first] = value