dynflow 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35bd7c7bd52da4f68946edb03d5d388d09f53cea
4
- data.tar.gz: 35800095dee5a7edc92ed87d605edc66e8190c34
3
+ metadata.gz: a92e48caa3237c278bd91fe10690740859ae29fc
4
+ data.tar.gz: 79b17f3f3119f954c58e6d2544f3a9725d51778d
5
5
  SHA512:
6
- metadata.gz: 2415804bf8a2c1a0b502db7bf685915aa7ae90365bd3316db269bdd187fa0d98357e1452181f23cbcf779c495fa4293046336a5ae700926b59566d9f47fe0187
7
- data.tar.gz: 9fb0b84f75bcc2055d523d61a706393eeb14479ce5939b73ec0d3b242aaf888c3a129a561acea88b598bcf3954b99deae3ea4919eede8b04f729e33b3dc6b528
6
+ metadata.gz: 58e2dab7d4634009ba158642d3959c60e2633d9ebdbe3b0c6afaa3c3b9f338868fb788e0ec4c55a9bc66032ff2e420375e496bc1c77c970edde83a57c965fe77
7
+ data.tar.gz: d9f22b6954465c5c08f9a0f9fdd059e8a9e4ebeb04f21ee2791b27597edf2b5697f7b7ee4926412b85d9095d29ff6e4c47a8258d03252745af0f2d25b9d1f233
@@ -37,7 +37,10 @@ module Dynflow
37
37
  end
38
38
 
39
39
  def cancel
40
- error("Delayed task cancelled", "Delayed task cancelled")
40
+ execution_plan.root_plan_step.state = :cancelled
41
+ execution_plan.root_plan_step.save
42
+ execution_plan.execution_history.add "Delayed task cancelled", @world.id
43
+ execution_plan.update_state :stopped
41
44
  @world.persistence.delete_delayed_plans(:execution_plan_uuid => @execution_plan_uuid)
42
45
  return true
43
46
  end
@@ -54,7 +54,7 @@ module Dynflow
54
54
  require 'dynflow/execution_plan/hooks'
55
55
 
56
56
  def self.results
57
- @results ||= [:pending, :success, :warning, :error]
57
+ @results ||= [:pending, :success, :warning, :error, :cancelled]
58
58
  end
59
59
 
60
60
  def self.state_transitions
@@ -148,7 +148,9 @@ module Dynflow
148
148
 
149
149
  def result
150
150
  all_steps = steps.values
151
- if all_steps.any? { |step| step.state == :error }
151
+ if all_steps.any? { |step| step.state == :cancelled }
152
+ return :cancelled
153
+ elsif all_steps.any? { |step| step.state == :error }
152
154
  return :error
153
155
  elsif all_steps.any? { |step| [:skipping, :skipped].include?(step.state) }
154
156
  return :warning
@@ -68,7 +68,7 @@ module Dynflow
68
68
  end
69
69
 
70
70
  def self.states
71
- @states ||= [:scheduling, :pending, :running, :success, :suspended, :skipping, :skipped, :error]
71
+ @states ||= [:scheduling, :pending, :running, :success, :suspended, :skipping, :skipped, :error, :cancelled]
72
72
  end
73
73
 
74
74
  def execute(*args)
@@ -59,12 +59,13 @@ module Dynflow
59
59
  end
60
60
 
61
61
  def self.state_transitions
62
- @state_transitions ||= { scheduling: [:pending, :error],
63
- pending: [:running, :error],
64
- running: [:success, :error],
62
+ @state_transitions ||= { scheduling: [:pending, :error, :cancelled],
63
+ pending: [:running, :error, :cancelled],
64
+ running: [:success, :error, :cancelled],
65
65
  success: [],
66
66
  suspended: [],
67
67
  skipped: [],
68
+ cancelled: [],
68
69
  error: [] }
69
70
  end
70
71
 
@@ -81,7 +81,8 @@ module Dynflow
81
81
  run(options[:rails_root], options)
82
82
  rescue => e
83
83
  STDERR.puts e.message
84
- ::Rails.logger.exception('Failed running Dynflow daemon', e)
84
+ ::Rails.logger.fatal('Failed running Dynflow daemon')
85
+ ::Rails.logger.fatal(e)
85
86
  exit 1
86
87
  end
87
88
  end
@@ -1,3 +1,3 @@
1
1
  module Dynflow
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  end
@@ -131,6 +131,8 @@ module Dynflow
131
131
  "success"
132
132
  when :error
133
133
  "danger"
134
+ when :cancelled
135
+ "warning"
134
136
  else
135
137
  "default"
136
138
  end
@@ -64,7 +64,7 @@ module Dynflow
64
64
  execution_plan.cancel.each(&:wait)
65
65
  execution_plan = world.persistence.load_execution_plan(self.execution_plan.id)
66
66
  execution_plan.state.must_equal :stopped
67
- execution_plan.result.must_equal :error
67
+ execution_plan.result.must_equal :cancelled
68
68
  assert_nil execution_plan.delay_record
69
69
  end
70
70
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Necas
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-04-27 00:00:00.000000000 Z
12
+ date: 2018-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json