File tree 4 files changed +5
-5
lines changed
spec/facter/resolvers/aix
4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ def find_size(name)
47
47
end
48
48
49
49
def compute_size ( size_hash )
50
- physical_partitions = size_hash [ 'TOTAL PPs' ] . to_i + size_hash [ 'FREE PPs' ] . to_i
50
+ physical_partitions = size_hash [ 'TOTAL PPs' ] . to_i
51
51
size_physical_partition = size_hash [ 'PP SIZE' ]
52
52
exp = if size_physical_partition [ /mega/ ]
53
53
Facter ::Util ::Aix ::InfoExtractor ::MEGABYTES_EXPONENT
Original file line number Diff line number Diff line change @@ -56,14 +56,14 @@ def populate_from_lslv(name)
56
56
end
57
57
58
58
def compute_size ( info_hash )
59
- physical_partitions = info_hash [ 'PPs ' ] . to_i
59
+ logical_partitions = info_hash [ 'LPs ' ] . to_i
60
60
size_physical_partition = info_hash [ 'PP SIZE' ]
61
61
exp = if size_physical_partition [ /mega/ ]
62
62
Facter ::Util ::Aix ::InfoExtractor ::MEGABYTES_EXPONENT
63
63
else
64
64
Facter ::Util ::Aix ::InfoExtractor ::GIGABYTES_EXPONENT
65
65
end
66
- size_physical_partition . to_i * physical_partitions * exp
66
+ size_physical_partition . to_i * logical_partitions * exp
67
67
end
68
68
end
69
69
end
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ def self.extract(content, cmd)
61
61
properties = PROPERTIES [ cmd ]
62
62
properties . each do |property |
63
63
str = ( properties - [ property ] ) . join ( '|' )
64
- matcher = content . match ( /#{ Regexp . escape ( property ) } ([^\n ]*?)(#{ str } |\n |$)/s )
64
+ matcher = content . match ( /(?:^|^[^:]+:[^:]+) #{ Regexp . escape ( property ) } ([^\n ]*?)(#{ str } |\n |$)/s )
65
65
if matcher
66
66
value = matcher [ 1 ] . strip
67
67
property_hash [ property . split ( ':' ) . first ] = value
Original file line number Diff line number Diff line change 28
28
let ( :result ) { load_fixture ( 'lspv_output' ) . read }
29
29
30
30
let ( :disks ) do
31
- { 'hdisk0' => { size : '30.00 GiB' , size_bytes : 32_212_254_720 } }
31
+ { 'hdisk0' => { size : '29.97 GiB' , size_bytes : 32_178_700_288 } }
32
32
end
33
33
34
34
before do
You can’t perform that action at this time.
0 commit comments