foreman-tasks 10.0.0 → 10.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
  SHA256:
3
- metadata.gz: 12c497c315d4ddc13756f00588584ebbb26fd0320231cc2e6a2b5e1e285ad1c6
4
- data.tar.gz: 404c59c211805039713e0d61411a649d21f318ad9f5e4a1f7872f2d2633dd3c4
3
+ metadata.gz: 34be658746dd0f136ff054fa6b9f381b9d2ee3758715219f4709f8b745ea1807
4
+ data.tar.gz: e4240056a3707edfccf95f90ed86c970f6e76d8eb5f7c1273987786a2dc97fb8
5
5
  SHA512:
6
- metadata.gz: 831bfb836cedcf996170dcb23db17edc1fb9c3606130cb0f1c8c946de3164e7a9059ef61e6bbf5fdde4fb3febe1cc6cd5e07c668f891dfda51926b89b5da6f3e
7
- data.tar.gz: e63d4cb1e9f172ff81bae074a6bba0abbb96b1c67369506e6e8a134f42fc161c46236d505ba4503ef8e9805a7ecf9015bb963b98c7bf78a5f88b4777c1345471
6
+ metadata.gz: b0a7729b58e671ce34f57adf83c052ca9af2e8e670e3302fa0d1dbee1ec82975f327a8a90fde202b2c68953dbdbdc1fd429330232911b002d2fdca77bf157bad
7
+ data.tar.gz: 2094c271990a108d4e804bf42f3e5b7464427674a4d46d26b130883ad057069141d2303286a0ee7fec7afbcc01bebd48d4d6c4955a64544107d2a2797cd558ad
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ locale/*/*.po.time_stamp
16
16
  node_modules
17
17
  package-lock.json
18
18
  coverage/
19
+ locale/action_names.rb
@@ -252,7 +252,7 @@ module ForemanTasks
252
252
 
253
253
  def prepare_filter
254
254
  filter_parts = [filter]
255
- filter_parts << %(started_at < "#{after.ago.to_s(:db)}") if after > 0
255
+ filter_parts << %(started_at < "#{after.ago.to_formatted_s(:db)}") if after > 0
256
256
  filter_parts << "state ^ (#{states.join(',')})" if states.any?
257
257
  filter_parts.select(&:present?).map { |segment| "(#{segment})" }.join(' AND ')
258
258
  end
@@ -310,15 +310,15 @@ namespace :foreman_tasks do
310
310
  SKIP_ERRORS = ['true', '1', 'y', 'yes'].include? (ENV['SKIP_FAILED'] || '').downcase
311
311
 
312
312
  filter = if ENV['TASK_SEARCH'].nil? && ENV['TASK_DAYS'].nil?
313
- "started_at > \"#{7.days.ago.to_s(:db)}\" || " \
314
- "(result != success && started_at > \"#{60.days.ago.to_s(:db)})\""
313
+ "started_at > \"#{7.days.ago.to_formatted_s(:db)}\" || " \
314
+ "(result != success && started_at > \"#{60.days.ago.to_formatted_s(:db)})\""
315
315
  else
316
316
  ENV['TASK_SEARCH'] || ''
317
317
  end
318
318
 
319
319
  if (days = ENV['TASK_DAYS'])
320
320
  filter += ' && ' unless filter == ''
321
- filter += "started_at > \"#{days.to_i.days.ago.to_s(:db)}\""
321
+ filter += "started_at > \"#{days.to_i.days.ago.to_formatted_s(:db)}\""
322
322
  end
323
323
 
324
324
  format = ENV['TASK_FORMAT'] || 'html'
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = '10.0.0'.freeze
2
+ VERSION = '10.0.2'.freeze
3
3
  end
data/lib/foreman_tasks.rb CHANGED
@@ -33,7 +33,7 @@ module ForemanTasks
33
33
  finished.wait(timeout)
34
34
  task = ForemanTasks::Task::DynflowTask.where(:external_id => id).first
35
35
  if task.nil? || (!task.paused? && task.pending?)
36
- raise TimeoutError, "The time waiting for task #{task.try(:id)} to finish exceeded the 'foreman_tasks_sync_task_timeout' (#{timeout}s)"
36
+ raise Timeout::Error, "The time waiting for task #{task.try(:id)} to finish exceeded the 'foreman_tasks_sync_task_timeout' (#{timeout}s)"
37
37
  end
38
38
  end
39
39
  task || ForemanTasks::Task::DynflowTask.where(:external_id => id).first!
@@ -8,21 +8,27 @@ if gettext_find_task
8
8
  namespace :gettext do
9
9
  task :store_action_names => :environment do
10
10
  storage_file = "#{locale_path}/action_names.rb"
11
- klasses = Actions::EntryAction
12
- .subclasses
13
- .uniq
14
- .select do |action|
15
- src, = Object.const_source_location(action.to_s)
16
- src.start_with? @engine.root.to_s
11
+ method_names = [:plan, :run, :finalize]
12
+ instances = Actions::EntryAction
13
+ .descendants
14
+ .uniq
15
+ .map(&:allocate)
16
+ .select do |action|
17
+ method_names.any? do |method_name|
18
+ if action.respond_to?(method_name)
19
+ src, = action.method(method_name).source_location
20
+ src.start_with? @engine.root.to_s
21
+ end
22
+ end
17
23
  end
18
24
 
19
- if klasses.any?
25
+ if instances.any?
20
26
  puts "writing action translations to: #{storage_file}"
21
27
 
22
28
  File.write storage_file,
23
29
  "# Autogenerated!\n" +
24
- klasses
25
- .map { |klass| %[_("#{klass.allocate.humanized_name}")] }
30
+ instances
31
+ .map { |instance| %[_("#{instance.humanized_name}")] }
26
32
  .sort
27
33
  .join("\n") + "\n"
28
34
  elsif File.exist? storage_file
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: 10.0.0
4
+ version: 10.0.2
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: 2024-09-10 00:00:00.000000000 Z
11
+ date: 2024-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynflow
@@ -318,7 +318,6 @@ files:
318
318
  - lib/foreman_tasks/version.rb
319
319
  - lib/tasks/gettext.rake
320
320
  - locale/Makefile
321
- - locale/action_names.rb
322
321
  - locale/de/LC_MESSAGES/foreman_tasks.mo
323
322
  - locale/de/foreman_tasks.po
324
323
  - locale/en/LC_MESSAGES/foreman_tasks.mo
@@ -642,7 +641,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
642
641
  - !ruby/object:Gem::Version
643
642
  version: '0'
644
643
  requirements: []
645
- rubygems_version: 3.3.26
644
+ rubygems_version: 3.3.27
646
645
  signing_key:
647
646
  specification_version: 4
648
647
  summary: Foreman plugin for showing tasks information for resources and users
@@ -1,6 +0,0 @@
1
- # Autogenerated!
2
- _("Action with sub plans")
3
- _("Check for long running tasks")
4
- _("Deliver notifications about long running tasks")
5
- _("Import Puppet classes")
6
- _("Import facts")