Skip to content

Commit f05f0e0

Browse files
committed
add vg_name to logical_volumes
1 parent 3058e94 commit f05f0e0

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

lib/facter/logical_volumes.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
'lv_active',
2727
'lv_size',
2828
'lv_permissions',
29+
'vg_name',
2930
]
3031

3132
output = Facter::Core::Execution.exec("lvs -o #{columns.join(',')} --noheading --nosuffix")
32-
Puppet_X::LVM::Output.parse('lv_name', columns, output)
33+
Puppet_X::LVM::Output.parse('lv_name', columns, output, 'lv_')
3334
end
3435
end

spec/unit/facter/logical_volumes_spec.rb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838

3939
it 'is able to resolve VGs' do
4040
lvs_output = <<-OUTPUT
41-
E7qan8-4NGf-jq2P-l11v-6fFe-MPHK-T6IGzl root centos/root /dev/centos/root /dev/mapper/centos-root -wi-ao---- linear public active 18.46g writeable
42-
buUXDX-GDUh-rN2t-y80n-vtCt-xhhu-XSZ5kA swap centos/swap /dev/centos/swap /dev/mapper/centos-swap -wi-ao---- linear public active 1.00g writeable
43-
uedsry-OTVv-wGW4-vaFf-c7IY-oH6Z-ig6IXB cool_tasks tasks/cool_tasks /dev/tasks/cool_tasks /dev/mapper/tasks-cool_tasks -wi-a----- linear public active 800.00m writeable
44-
gmNS3G-cAhA-vRj0-2Uf0-21yO-QVdy-LNXfBv lame_tasks tasks/lame_tasks /dev/tasks/lame_tasks /dev/mapper/tasks-lame_tasks -wi-a----- linear public active 400.00m writeable
41+
E7qan8-4NGf-jq2P-l11v-6fFe-MPHK-T6IGzl root centos/root /dev/centos/root /dev/mapper/centos-root -wi-ao---- linear public active 18.46g writeable centos
42+
buUXDX-GDUh-rN2t-y80n-vtCt-xhhu-XSZ5kA swap centos/swap /dev/centos/swap /dev/mapper/centos-swap -wi-ao---- linear public active 1.00g writeable centos
43+
uedsry-OTVv-wGW4-vaFf-c7IY-oH6Z-ig6IXB cool_tasks tasks/cool_tasks /dev/tasks/cool_tasks /dev/mapper/tasks-cool_tasks -wi-a----- linear public active 800.00m writeable tasks
44+
gmNS3G-cAhA-vRj0-2Uf0-21yO-QVdy-LNXfBv lame_tasks tasks/lame_tasks /dev/tasks/lame_tasks /dev/mapper/tasks-lame_tasks -wi-a----- linear public active 400.00m writeable tasks
4545
OUTPUT
4646
lvs_output.dup.lstrip!
4747
Facter::Core::Execution.expects(:exec).at_least(1).returns(lvs_output)
@@ -55,7 +55,8 @@
5555
'role' => 'public',
5656
'active' => 'active',
5757
'size' => '800.00m',
58-
'permissions' => 'writeable'
58+
'permissions' => 'writeable',
59+
'vg_name' => 'tasks',
5960
},
6061
'lame_tasks' => {
6162
'uuid' => 'gmNS3G-cAhA-vRj0-2Uf0-21yO-QVdy-LNXfBv',
@@ -67,7 +68,8 @@
6768
'role' => 'public',
6869
'active' => 'active',
6970
'size' => '400.00m',
70-
'permissions' => 'writeable'
71+
'permissions' => 'writeable',
72+
'vg_name' => 'tasks',
7173
},
7274
'root' => {
7375
'uuid' => 'E7qan8-4NGf-jq2P-l11v-6fFe-MPHK-T6IGzl',
@@ -79,7 +81,8 @@
7981
'role' => 'public',
8082
'active' => 'active',
8183
'size' => '18.46g',
82-
'permissions' => 'writeable'
84+
'permissions' => 'writeable',
85+
'vg_name' => 'centos',
8386
},
8487
'swap' => {
8588
'uuid' => 'buUXDX-GDUh-rN2t-y80n-vtCt-xhhu-XSZ5kA',
@@ -91,7 +94,8 @@
9194
'role' => 'public',
9295
'active' => 'active',
9396
'size' => '1.00g',
94-
'permissions' => 'writeable'
97+
'permissions' => 'writeable',
98+
'vg_name' => 'centos',
9599
})
96100
end
97101
end

0 commit comments

Comments
 (0)