foreman-tasks 0.7.4 → 0.7.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzAzZDZlZGRhYjg2OWM2ZGU3NTdkMGMzMmZmMTg4ZDJhODU3NjU3NA==
4
+ ZmZhMjBlOGVlMDU5NDI1NjNhZWRhNDM3Mjk5MzM3NTdhOTI4ZWE2MQ==
5
5
  data.tar.gz: !binary |-
6
- NzQ1ZDRmODAwYzg3ODhhNThjMGVmNmQyZDQwNDA3NDliNjVkYjYxNQ==
6
+ MmFkYzY1MzcxOTZiNTgxMzUyNjAxZTI4ZDYyOWI2N2FlOGVmMzA5Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2U4ZmQ0ZTE4MTZkNDlmMWRmYmEzYThhODJiYWQwZTEyOTQyY2Q3MWZjMzM1
10
- NDJlNjQ1YWNjNWU5ODgzZmE3NjVmN2Q0Y2YzMGI4Y2NlZjZkN2RmODcyYzRk
11
- ODc5Y2FlNWQ5ZDE3YjlmODYyMWYzYTI3YTljOWIxMTdmOWYwMzE=
9
+ YzIwNTJlMmY5MGVmNWY4OWM2MWMwNjFhODkzZjkzZTFmMDZlYjcyMjI1YjIz
10
+ YzQ2ZjE0YTFlZDgzYTM4MjQ5Njk5ZmJjZmU5ZTJhY2Y0Y2E3M2M2NDFkOTdl
11
+ ZTQ5N2ZhMTg4MTA1YWQ3OTIyMjFlY2I1MjgxMDBiNjQ1NWQxNzk=
12
12
  data.tar.gz: !binary |-
13
- YTU2ZjFlNTY2ZjI3MzA5ZmMxMWQ2YzQzMDQxMTZjMjY3NDExMjNmNjVlZjkz
14
- ZjJhOGRlODk5OTgxOGIyZDI0NzE0YjY3ZmFhZDQxNmE4NGFlYWQ4Y2Q3ZWMw
15
- MTY5MWMwNjMzNDVlOWJiMzE2YWZjMTgwZjc0NDZkZjYyNmE2MWY=
13
+ ZTI2YjJjYzc4NzUwZjA1YWIzMzNlZDIxNTk0OTFiZGU5NDZkYzQzNjgyNjE3
14
+ MGVkODE5ODdjMDhmODlmYWQ5YzI3MGU2ZjZmYzM2NjE2NGYyODA3N2FhNDkx
15
+ NDRkZGNlNzJhNTE5YzczMDIyYjBhOGU5OGY2NjkwZGFjYzA4ZTg=
@@ -55,14 +55,14 @@ module Actions
55
55
  def check_task_status
56
56
  if output[:proxy_task_id]
57
57
  response = proxy.status_of_task(output[:proxy_task_id])
58
- if response['state'] == 'stopped'
58
+ if %w(stopped paused).include? response['state']
59
59
  if response['result'] == 'error'
60
60
  raise ::Foreman::Exception, _("The smart proxy task '#{output[:proxy_task_id]}' failed.")
61
61
  else
62
62
  on_data(response['actions'].find { |block_action| block_action['class'] == proxy_action_name }['output'])
63
63
  end
64
64
  else
65
- cancel_proxy_task
65
+ suspend
66
66
  end
67
67
  else
68
68
  process_timeout
@@ -129,7 +129,9 @@ module Actions
129
129
  def default_connection_options
130
130
  # Fails if the plan is not finished within 60 seconds from the first task trigger attempt on the smart proxy
131
131
  # If the triggering fails, it retries 3 more times with 15 second delays
132
- { :retry_interval => 15, :retry_count => 4, :timeout => 60 }
132
+ { :retry_interval => Setting['foreman_tasks_proxy_action_retry_interval'] || 15,
133
+ :retry_count => Setting['foreman_tasks_proxy_action_retry_count' ] || 4,
134
+ :timeout => Setting['foreman_tasks_proxy_action_start_timeout'] || 60 }
133
135
  end
134
136
 
135
137
  private
@@ -30,6 +30,10 @@ module ProxyAPI
30
30
  def status_of_task(proxy_task_id)
31
31
  MultiJson.load(Task.new(@args).send(:get, "#{ proxy_task_id }/status"))
32
32
  end
33
+
34
+ def tasks_count(state)
35
+ MultiJson.load(Task.new(@args).send(:get, "count?state=#{state}"))['count'].to_i
36
+ end
33
37
  end
34
38
  end
35
39
  end
@@ -8,7 +8,10 @@ class Setting::ForemanTasks < Setting
8
8
  [
9
9
  self.set('dynflow_allow_dangerous_actions', N_("Allow unlocking actions which can have dangerous consequences."), false),
10
10
  self.set('dynflow_enable_console', N_("Enable the dynflow console (/foreman_tasks/dynflow) for debugging"), true),
11
- self.set('dynflow_console_require_auth', N_("Require user to be authenticated as user with admin rights when accessing dynflow console"), true)
11
+ self.set('dynflow_console_require_auth', N_("Require user to be authenticated as user with admin rights when accessing dynflow console"), true),
12
+ self.set('foreman_tasks_proxy_action_retry_count', N_("Number of attempts to start a task on the smart proxy before failing"), 4),
13
+ self.set('foreman_tasks_proxy_action_retry_interval', N_("Time in seconds between retries"), 15),
14
+ self.set('foreman_tasks_proxy_action_start_timeout', N_("Time in second during which a task has to be started on the proxy"), 60)
12
15
  ].each { |s| self.create! s.update(:category => "Setting::ForemanTasks")}
13
16
  end
14
17
 
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = "0.7.4"
2
+ VERSION = "0.7.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-17 00:00:00.000000000 Z
11
+ date: 2015-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynflow