Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Fix apply prep for inventory v2 #1303

Merged
merged 2 commits into from Oct 14, 2019

Conversation

donoghuc
Copy link
Member

Previously the default plugin_hooks from config were not being set on a Target2 object. This was causing failures in apply prep

opts = t.plugin_hooks&.fetch('puppet_library')
which assumes that plugin_hooks will have a value. This commit updates the inventory 2 update_target_state to consider the plugin_hooks set in config. The merge order in order of precedence is target level in inventory, group level in inventory, specified in bolt.yaml, default.

@donoghuc donoghuc requested a review from a team as a code owner October 11, 2019 15:29
Previously the default plugin_hooks from config were not being set on a Target2 object. This was causing failures in apply prep https://github.com/puppetlabs/bolt/blob/345131e31c02a3047c1607ce3b6df0a484976542/bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb#L103 which assumes that `plugin_hooks` will have a value. This commit updates the inventory 2 update_target_state to consider the `plugin_hooks` set in config. The merge order in order of precedence is target level in inventory, group level in inventory, specified in bolt.yaml, default.
@puppetcla
Copy link

CLA signed by all contributors.

let(:plugins) { Bolt::Plugin.new(config, pal, Bolt::Analytics::NoopClient.new) }
let(:inventory) { Bolt::Inventory.create_version(data, config, plugins) }
let(:target) { inventory.get_target(hostname) }
let(:targets) { inventory.get_targets(hostname) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this gets used anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, targets is used in the before each block.

@lucywyman lucywyman added this to 🚧 Reviewing in DEPRECATED: old Bolt Kanban via automation Oct 14, 2019
@lucywyman lucywyman merged commit 03f05e7 into puppetlabs:master Oct 14, 2019
@lucywyman lucywyman removed this from 🚧 Reviewing in DEPRECATED: old Bolt Kanban Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants