Skip to content

Commit 4f9b928

Browse files
committed
(maint) pass full inventory path to task
1 parent 144ba65 commit 4f9b928

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/puppet_litmus/rake_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def provision(provisioner, platform, inventory_vars)
6868
raise "the provision module was not found in #{DEFAULT_CONFIG_DATA['modulepath']}, please amend the .fixtures.yml file" unless
6969
File.directory?(File.join(DEFAULT_CONFIG_DATA['modulepath'], 'provision'))
7070

71-
params = { 'action' => 'provision', 'platform' => platform, 'inventory' => Dir.pwd }
71+
params = { 'action' => 'provision', 'platform' => platform, 'inventory' => File.join(Dir.pwd, 'spec', 'fixtures', 'litmus_inventory.yaml') }
7272
params['vars'] = inventory_vars unless inventory_vars.nil?
7373

7474
task_name = provisioner_task(provisioner)

spec/lib/puppet_litmus/rake_helper_spec.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
let(:provision_hash) { args[:provision_hash] }
1010
let(:results) { args[:results] }
1111
let(:params) { args[:params] }
12+
let(:inventory_file) { File.join(Dir.pwd, 'spec', 'fixtures', 'litmus_inventory.yaml') }
1213

1314
it 'calls function' do
1415
allow(File).to receive(:directory?).and_call_original
@@ -42,15 +43,15 @@
4243
inventory_vars: nil,
4344
provision_hash: { 'default' => { 'provisioner' => 'docker', 'images' => ['waffleimage/centos7'] } },
4445
results: [],
45-
params: { 'action' => 'provision', 'platform' => 'waffleimage/centos7', 'inventory' => Dir.pwd }
46+
params: { 'action' => 'provision', 'platform' => 'waffleimage/centos7', 'inventory' => inventory_file }
4647
},
4748
{
4849
provisioner: 'vagrant',
4950
platform: 'centos7',
5051
inventory_vars: nil,
5152
provision_hash: { 'default' => { 'provisioner' => 'vagrant', 'images' => ['centos7'] } },
5253
results: [],
53-
params: { 'action' => 'provision', 'platform' => 'centos7', 'inventory' => Dir.pwd }
54+
params: { 'action' => 'provision', 'platform' => 'centos7', 'inventory' => inventory_file }
5455
}
5556
].freeze
5657

@@ -68,7 +69,7 @@
6869
[{ 'uri' => 'some.host', 'facts' => { 'provisioner' => 'docker', 'container_name' => 'foo', 'platform' => 'some.host' } }] }] }
6970
end
7071
let(:targets) { ['some.host'] }
71-
let(:params) { { 'action' => 'tear_down', 'node_name' => 'some.host', 'inventory' => Dir.pwd } }
72+
let(:params) { { 'action' => 'tear_down', 'node_name' => 'some.host', 'inventory' => inventory_file } }
7273

7374
it 'calls function' do
7475
allow(File).to receive(:directory?).with(File.join(described_class::DEFAULT_CONFIG_DATA['modulepath'], 'provision')).and_return(true)
@@ -89,7 +90,7 @@
8990
] }] }
9091
end
9192
let(:targets) { ['one.host'] }
92-
let(:params) { { 'action' => 'tear_down', 'node_name' => 'one.host', 'inventory' => Dir.pwd } }
93+
let(:params) { { 'action' => 'tear_down', 'node_name' => 'one.host', 'inventory' => inventory_file } }
9394

9495
it 'calls function' do
9596
allow(File).to receive(:directory?).with(File.join(described_class::DEFAULT_CONFIG_DATA['modulepath'], 'provision')).and_return(true)

0 commit comments

Comments
 (0)