Skip to content

Commit a0c5793

Browse files
committed
fixed assert failure when passing empty array as settings in volume type
1 parent 558f8b5 commit a0c5793

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

manifests/volume.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
$_transport = "transport ${transport}"
7676

77-
if $options {
77+
if $options and ! empty( $options ) {
7878
$_options = sort( $options )
7979
} else {
8080
$_options = undef

spec/defines/volume_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,16 @@
107107
it { is_expected.to compile.with_all_deps }
108108
it { is_expected.to contain_exec("gluster create volume #{title}") }
109109
end
110+
describe 'with empty options' do
111+
let(:facts) do
112+
{
113+
gluster_binary: '/usr/sbin/gluster'
114+
}
115+
end
116+
let(:params) do
117+
super().merge(options: [])
118+
end
119+
120+
it { is_expected.to compile.with_all_deps }
121+
end
110122
end

0 commit comments

Comments
 (0)