foreman-tasks 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62a10715bd5b194c1cb750c2f100b60a2f3bca155e0df6d303b284cf157a87d9
4
- data.tar.gz: fd24e269912731dd0e2cee07e99e694dbf98547cab3a3d3dd89963f87d2dc3b9
3
+ metadata.gz: e37924776f38fa00d98c1389b22baff43347f4f4c28c0d3848de93951b5cd1d9
4
+ data.tar.gz: 49c49253f6cd157b6c602bb1ceb5bee9b249aee207939501b60e273b4fce1734
5
5
  SHA512:
6
- metadata.gz: 011ae333df38537c17b1593a06f41828aa600e45d653c4231644b7d86e0a0ea92016de9d36abb067c432eb4e04466bec72e9ceb9f6ad87be3142b9896d7f18e4
7
- data.tar.gz: 0c06ac795bc95787682262e42e8330b5b1e10d0923bc68581ba19623be01cac63ab6bab70d67a168a51c61b2f34f383f19c95276eee9fd564fb7a8c32edec16f
6
+ metadata.gz: 53aebec3deef276e131483dc20f5ce3753a9bf8b7d64e9a443af9a0284e9749a657c97e03923034db81e1a698aa24d0de120fe3530b5768725e9a910f8b34e52
7
+ data.tar.gz: ae5931295bc54e9bfcf3b48278c52724265ddc0e902d39be2d05897f1231b5c29291810f7e638d83f0a436a6f0a414453692158ad9b93c2445db038e87872168
@@ -31,12 +31,12 @@ module ForemanTasks
31
31
  if value
32
32
  task.update!(:start_at => next_occurrence_time) if task.start_at < Time.zone.now
33
33
  update(:state => 'active')
34
- else
35
- update(:state => 'disabled')
36
34
  end
37
- else
35
+ elsif value
38
36
  raise RecurringLogicCancelledException
39
37
  end
38
+
39
+ update(:state => 'disabled') unless value
40
40
  end
41
41
 
42
42
  def enabled?
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = '2.0.2'.freeze
2
+ VERSION = '2.0.3'.freeze
3
3
  end
@@ -148,6 +148,12 @@ class RecurringLogicsTest < ActiveSupport::TestCase
148
148
  assert ForemanTasks.dynflow.world.persistence.load_delayed_plan(task.execution_plan.id).frozen
149
149
  end
150
150
 
151
+ it 'handles if the task has been deleted' do
152
+ logic.tasks.find_by(:state => 'scheduled').destroy
153
+ logic.update!(:enabled => false)
154
+ assert_equal 'disabled', logic.state
155
+ end
156
+
151
157
  it 'properly re-enables on disable' do
152
158
  logic.update!(:enabled => false)
153
159
  logic.update!(:enabled => true)
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: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-09 00:00:00.000000000 Z
11
+ date: 2021-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynflow
@@ -580,7 +580,7 @@ files:
580
580
  homepage: https://github.com/theforeman/foreman-tasks
581
581
  licenses: []
582
582
  metadata: {}
583
- post_install_message:
583
+ post_install_message:
584
584
  rdoc_options: []
585
585
  require_paths:
586
586
  - lib
@@ -595,8 +595,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
595
595
  - !ruby/object:Gem::Version
596
596
  version: '0'
597
597
  requirements: []
598
- rubygems_version: 3.0.3
599
- signing_key:
598
+ rubygems_version: 3.1.2
599
+ signing_key:
600
600
  specification_version: 4
601
601
  summary: Foreman plugin for showing tasks information for resources and users
602
602
  test_files: