Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #615 from ExalDraen/bolt-supp-facts-update
Browse files Browse the repository at this point in the history
(#616) Extract playbook name correcly from facts
  • Loading branch information
ripienaar committed Dec 5, 2019
2 parents ff398cf + ff51895 commit 44ce823
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/mcollective/util/bolt_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ def run_task(scope, type, properties)
def assign_playbook_name(scope)
return unless scope
return unless scope["facts"]["choria"]
return unless scope["facts"]["choria"]["plan"]
return unless scope["facts"]["choria"]["playbook"]

playbook.metadata["name"] = scope["facts"]["choria"]["plan"]
playbook.metadata["name"] = scope["facts"]["choria"]["playbook"]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/mcollective/util/bolt_support_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Util
describe "#assign_playbook_name" do
it "should assign the playbook name from scope" do
expect(playbook.name).to be_nil
support.assign_playbook_name("facts" => {"choria" => {"plan" => "rspec"}})
support.assign_playbook_name("facts" => {"choria" => {"playbook" => "rspec"}})
expect(playbook.name).to eq("rspec")
end

Expand Down

0 comments on commit 44ce823

Please sign in to comment.