File tree Expand file tree Collapse file tree
lib/puppet/provider/onedatastore Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,7 +61,12 @@ def exists?
6161 def self . get_datastore ( xml )
6262 datastore_hash = Hash . new
6363 get_attributes . each do |node |
64- if node == :type
64+ if node == :base_path
65+ ## removes a char, one or more digits from the end
66+ # required to match basepath /tmp vs /tmp/102
67+ text = xml . css ( "#{ node . to_s . upcase } " ) . first . text . sub! ( /.\d +\z / , '' )
68+ datastore_hash [ node ] = text
69+ elsif node == :type
6570 case xml . css ( "#{ node . to_s . upcase } " ) . first . text
6671 when '0' then text = 'IMAGE_DS'
6772 when '1' then text = 'SYSTEM_DS'
Original file line number Diff line number Diff line change @@ -55,6 +55,23 @@ class { 'one':
5555 end
5656 end
5757
58+ context "with custom basepath" do
59+ it 'should idempotently run' do
60+ pp = <<-EOS
61+ onedatastore { 'nfs_ds':
62+ ensure => present,
63+ type => 'system_ds',
64+ tm_mad => 'shared',
65+ driver => 'raw',
66+ disk_type => 'file',
67+ base_path => '/tmp',
68+ }
69+ EOS
70+
71+ apply_manifest ( pp , :catch_failures => true )
72+ apply_manifest ( pp , :catch_changes => true )
73+ end
74+ end
5875 end
5976
6077 describe 'when creating a File datastore' do
You can’t perform that action at this time.
0 commit comments