Skip to content

Commit

Permalink
(MODULES-8695) Remove Ruby 2.0 keyword arg syntax
Browse files Browse the repository at this point in the history
This code needs to be compatible with Ruby 1.9 syntax in order to
support PE 2016.4.x, and possibly even PE 2018.1.x due to jruby 1.7
(Ruby 1.9 compatible) being used in puppetserver in those versions.
  • Loading branch information
reidmv committed Feb 27, 2019
1 parent 98d69f5 commit c5e6da6
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit c5e6da6

Please sign in to comment.