Skip to content

Commit

Permalink
Merge pull request #1051 from pcarlisle/rk-343-cri
Browse files Browse the repository at this point in the history
(RK-343) Update option handling for new CRI
  • Loading branch information
mwaggett authored Apr 28, 2020
2 parents 8bd9093 + 574f6af commit 9ef35e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/r10k/action/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def setup_settings
config_settings = settings_from_config(@opts[:config])

overrides = {}
overrides[:cachedir] = @opts[:cachedir] unless @opts[:cachedir].nil?
overrides[:deploy] = {} if !@opts[:'puppet-path'].nil? || !@opts[:'generate-types'].nil?
overrides[:deploy][:puppet_path] = @opts[:'puppet-path'] unless @opts[:'puppet-path'].nil?
overrides[:deploy][:generate_types] = @opts[:'generate-types'] unless @opts[:'generate-types'].nil?
overrides[:cachedir] = @opts[:cachedir] if @opts.key?(:cachedir)
overrides[:deploy] = {} if @opts.key?(:'puppet-path') || @opts.key?(:'generate-types')
overrides[:deploy][:puppet_path] = @opts[:'puppet-path'] if @opts.key?(:'puppet-path')
overrides[:deploy][:generate_types] = @opts[:'generate-types'] if @opts.key?(:'generate-types')

with_overrides = config_settings.merge(overrides) do |key, oldval, newval|
newval = oldval.merge(newval) if oldval.is_a? Hash
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/action/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def call
else
{ "#{conf_path}": override }
end
expect(global_settings).to receive(:evaluate).with(overrides).and_call_original
expect(global_settings).to receive(:evaluate).with(hash_including(overrides)).and_call_original
runner.call
end
end
Expand All @@ -109,7 +109,7 @@ def call
else
{ "#{conf_path}": override }
end
expect(global_settings).to receive(:evaluate).with(overrides).and_call_original
expect(global_settings).to receive(:evaluate).with(hash_including(overrides)).and_call_original
runner.call
end
end
Expand Down

0 comments on commit 9ef35e4

Please sign in to comment.