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

(MODULES-8695) Remove Ruby 2.0 keyword arg syntax #77

Merged
merged 1 commit into from
Feb 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/puppet_x/puppetlabs/scheduled_task/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,15 @@ def self.task(task_path)
end

# Find the first TASK_ACTION_EXEC action
def default_action(create_if_missing: false)
def default_action(options = {})
action = nil
(1..@definition.Actions.count).each do |i|
index_action = action_at(i)
action = index_action if index_action.Type == TASK_ACTION_TYPE::TASK_ACTION_EXEC
break if action
end

if action.nil? && create_if_missing
if action.nil? && options.fetch(:create_if_missing, false)
action = @definition.Actions.Create(TASK_ACTION_TYPE::TASK_ACTION_EXEC)
end

Expand Down