Skip to content

Commit 427287d

Browse files
authored
Merge pull request #296 from puppetlabs/gh-295-fix_vg_datatype
(GH-295) - fix vg datatype
2 parents d7c5136 + 66bad02 commit 427287d

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
lines changed

.rubocop_todo.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2023-05-30 12:44:48 UTC using RuboCop version 1.48.1.
3+
# on 2023-06-07 11:03:43 UTC using RuboCop version 1.48.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -98,7 +98,7 @@ RSpec/ContextWording:
9898
Exclude:
9999
- 'spec/unit/puppet/provider/logical_volume/lvm_spec.rb'
100100

101-
# Offense count: 22
101+
# Offense count: 23
102102
# Configuration parameters: IgnoredMetadata.
103103
RSpec/DescribeClass:
104104
Enabled: false
@@ -133,11 +133,12 @@ RSpec/MultipleDescribes:
133133
Exclude:
134134
- 'spec/unit/facter/lvm_support_spec.rb'
135135

136-
# Offense count: 25
136+
# Offense count: 26
137137
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
138138
# SupportedStyles: always, named_only
139139
RSpec/NamedSubject:
140140
Exclude:
141+
- 'spec/defines/volume_spec.rb'
141142
- 'spec/functions/bytes_to_size_spec.rb'
142143
- 'spec/functions/size_to_bytes_spec.rb'
143144
- 'spec/unit/classes/lvm_spec.rb'

REFERENCE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ Data type: `Stdlib::Absolutepath`
436436

437437
##### <a name="-lvm--volume--vg"></a>`vg`
438438

439-
Data type: `Stdlib::Absolutepath`
439+
Data type: `String[1]`
440440

441441

442442

lib/puppet/type/logical_volume.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ def insync?(is)
174174
desc 'An optimization in lvcreate, at least on Linux.'
175175
end
176176
newparam(:region_size) do
177-
desc 'A mirror is divided into regions of this size (in MB), the mirror log uses this granularity to track which regions are in sync. CAN NOT BE CHANGED on already mirrored volume.' \
178-
'Take your mirror size in terabytes and round up that number to the next power of 2, using that number as the -R argument.'
177+
desc 'A mirror is divided into regions of this size (in MB), the mirror log uses this granularity to track which regions are in sync. CAN NOT BE CHANGED on already mirrored volume. Take your mirror size in terabytes and round up that number to the next power of 2, using that number as the -R argument.' # rubocop:disable Layout/LineLength
179178
validate do |value|
180179
raise ArgumentError, "#{value} is not a valid region size in MB." unless %r{^[0-9]+$}i.match?(value.to_s)
181180
end

manifests/volume.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
define lvm::volume (
6565
Enum['present', 'absent', 'cleaned'] $ensure,
6666
Stdlib::Absolutepath $pv,
67-
Stdlib::Absolutepath $vg,
67+
String[1] $vg,
6868
Optional[String[1]] $fstype = undef,
6969
Optional[String[1]] $size = undef,
7070
Optional[Variant[String[1], Integer]] $extents = undef,

spec/defines/volume_spec.rb

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
5+
describe 'lvm::volume' do
6+
let(:title) { 'lv_example0' }
7+
8+
context 'when passed valid parameters, it will compile' do
9+
let :params do
10+
{
11+
ensure: 'present',
12+
vg: 'vg_example0',
13+
pv: '/dev/sdd1',
14+
fstype: 'ext4',
15+
size: '100GB'
16+
}
17+
end
18+
19+
it {
20+
expect(subject).to compile
21+
}
22+
end
23+
end

0 commit comments

Comments
 (0)