foreman-tasks 0.7.12 → 0.7.13

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: 52b001e513de0c0d5f488f10c6d8189947322374
4
- data.tar.gz: c706e8621d354642f59ab9eab53b01fadc1f4e60
3
+ metadata.gz: 540901d45b40d16fded94918dcf5e85a6837366c
4
+ data.tar.gz: c170dac55f4b345385ff53bb29985535634816ff
5
5
  SHA512:
6
- metadata.gz: 422cb384a3bcfb144f5c845b4fe31a3aa4bfebaf3b58143900d4a1ce26891a4c5bd0af9804a94c3547d0c8d9564e9cc43062435809d8d5103250d9594df5aa9d
7
- data.tar.gz: bf86c24e79a38c54011b3fe9bb0852ebb5cac94071af659be497dc6f2f096607a1fa906fc35a73a507d7b7aa561308e74ee45efe8e52c4515200261a96ad50e3
6
+ metadata.gz: 8126d89fc3a5fd2c579ffbae50baf44bdedf93986e052079db70dc683a80f255946014e741a075aa271617befa62347bad2c12cebd59520570891aed24706f4d
7
+ data.tar.gz: 392ae556aab5d96b791d09a1929b439beaf21524981c48e97097a96336b5010082a3eb46b8fc30121cb99d66bbb70f85ad57d0483582aa7c2a05bd2147fd15dd
@@ -86,7 +86,7 @@ module ForemanTasks
86
86
 
87
87
  api :POST, '/tasks/bulk_resume', N_('Resume all paused error tasks')
88
88
  param :search, String, :desc => N_('Resume tasks matching search string')
89
- param :task_ids, Array, :desc => N_('Resume specific tasks by id')
89
+ param :task_ids, Array, :desc => N_('Resume specific tasks by ID')
90
90
  def bulk_resume
91
91
  scope = resource_scope
92
92
  scope = scope.search_for(params[:search]) if params[:search]
@@ -125,7 +125,7 @@ module ForemanTasks
125
125
  param :search, String, :desc => N_("Search string")
126
126
  param :page, :number, :desc => N_("Page number, starting at 1")
127
127
  param :per_page, :number, :desc => N_("Number of results per page to return")
128
- param :order, String, :desc => N_("Sort field and order, eg. 'name DESC'")
128
+ param :order, String, :desc => N_("Sort field and order, e.g. 'name DESC'")
129
129
  param :sort, Hash, :desc => N_("Hash version of 'order' param") do
130
130
  param :by, String, :desc => N_("Field to sort the results on")
131
131
  param :order, String, :desc => N_("How to order the sorted results (e.g. ASC for ascending)")
@@ -164,7 +164,7 @@ module ForemanTasks
164
164
  api :POST, '/tasks/callback', N_("Send data to the task from external executor (such as smart_proxy_dynflow)")
165
165
  param :callback, Hash do
166
166
  param :task_id, :identifier, :desc => N_("UUID of the task")
167
- param :step_id, String, :desc => N_("The id of the step inside the execution plan to send the event to ")
167
+ param :step_id, String, :desc => N_("The ID of the step inside the execution plan to send the event to")
168
168
  end
169
169
  param :data, Hash, :desc => N_("Data to be sent to the action")
170
170
  def callback
@@ -213,7 +213,7 @@ module ForemanTasks
213
213
  end
214
214
  scope.where(id: search_params[:task_id])
215
215
  else
216
- raise BadRequest, _("Search_Params %s not supported") % search_params[:type]
216
+ raise BadRequest, _("Type %s for search_params is not supported") % search_params[:type]
217
217
  end
218
218
  end
219
219
 
@@ -31,7 +31,7 @@ module ForemanTasks
31
31
  if task.cancel
32
32
  flash[:notice] = _('Trying to cancel the task')
33
33
  else
34
- flash[:warning] = _('The task is not cancellable at the moment.')
34
+ flash[:warning] = _('The task cannot be cancelled at the moment.')
35
35
  end
36
36
  redirect_to :back
37
37
  end
@@ -25,7 +25,7 @@ module ForemanTasks
25
25
 
26
26
  def recurring_logic_next_occurrence(recurring_logic)
27
27
  if %w(finished cancelled).include? recurring_logic.state
28
- N_('-')
28
+ '-'
29
29
  else
30
30
  recurring_logic.next_occurrence_time
31
31
  end
@@ -87,15 +87,20 @@ module ForemanTasks
87
87
 
88
88
  def cronline_fieldset(f, triggering)
89
89
  options = [
90
+ # TRANSLATORS: this translation is referring to an option which is a time interval
90
91
  _('is minute (range: 0-59)'),
92
+ # TRANSLATORS: this translation is referring to an option which is a time interval
91
93
  _('is hour (range: 0-23)'),
94
+ # TRANSLATORS: this translation is referring to an option which is a time interval
92
95
  _('is day of month (range: 1-31)'),
96
+ # TRANSLATORS: this translation is referring to an option which is a time interval
93
97
  _('is month (range: 1-12)'),
98
+ # TRANSLATORS: this translation is referring to an option which is a time interval
94
99
  _('is day of week (range: 0-6)')
95
100
  ].map { |opt| content_tag(:li, opt) }.join
96
101
  help = content_tag(:span, nil, :class => 'help-inline') do
97
102
  popover(_('Explanation'),
98
- _("Cron line format 'a b c d e', where:<br><ol type=\"a\">#{options}</ol>"))
103
+ _("Cron line format 'a b c d e', where: %s") % ("<br><ol type=\"a\">#{options}</ol>"))
99
104
  end
100
105
  content_tag(:fieldset, nil, :class => "input_type_form #{'hidden' unless triggering.input_type == :cronline}", :id => "input_type_cronline") do
101
106
  text_f f, :cronline, :label => _('Cron line'), :placeholder => '* * * * *', :help_inline => help
@@ -128,11 +133,13 @@ module ForemanTasks
128
133
  def time_picker_fieldset(f, triggering)
129
134
  tags = []
130
135
  tags << content_tag(:fieldset, nil, :id => 'time_picker', :class => "input_type_form #{'hidden' if triggering.input_type == :cronline}") do
136
+ # TRANSLATORS: Time widget for when a task should start
131
137
  time_f(f, :time, { :label => _("At"), :id => 'something' }, { :time_separator => '' })
132
138
  end
133
139
  tags << number_f(f, :max_iteration, :label => _('Repeat N times'), :min => 1, :placeholder => 'N')
134
140
  tags << field(f, :end_time_limit_select, :label => _("Ends"), :control_group_id => "end_time_limit_select") do
135
141
  radio_button_f(f, :end_time_limited, :value => false, :checked=> true, :text => _("Never"), :class => 'end_time_limit_selector') +
142
+ # TRANSLATORS: Button text for saying when a task should end
136
143
  radio_button_f(f, :end_time_limited, :value => true, :text => _("On"), :class => 'end_time_limit_selector')
137
144
  end
138
145
  tags << content_tag(:fieldset, nil, :id => 'end_time_limit_form', :class => "input_type_form #{'hidden' unless triggering.end_time_limited}") do
@@ -12,7 +12,7 @@ module Actions
12
12
 
13
13
  def humanized_output
14
14
  return unless counts_set?
15
- _("%{total} tasks, %{success} success, %{failed} fail") %
15
+ _("%{total} task(s), %{success} success, %{failed} fail") %
16
16
  { total: output[:total_count],
17
17
  success: output[:success_count],
18
18
  failed: output[:failed_count] }
@@ -15,7 +15,7 @@ module Actions
15
15
  end
16
16
 
17
17
  def humanized_name
18
- _("Import puppetclasses")
18
+ _("Import Puppet classes")
19
19
  end
20
20
 
21
21
  # default value for cleaning up the tasks, it can be overriden by settings
@@ -25,4 +25,4 @@ module Actions
25
25
  end
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -57,7 +57,7 @@ module Actions
57
57
  response = proxy.status_of_task(output[:proxy_task_id])
58
58
  if %w(stopped paused).include? response['state']
59
59
  if response['result'] == 'error'
60
- raise ::Foreman::Exception, _("The smart proxy task '#{output[:proxy_task_id]}' failed.")
60
+ raise ::Foreman::Exception, _("The smart proxy task %s failed.") % (output[:proxy_task_id])
61
61
  else
62
62
  on_data(response['actions'].find { |block_action| block_action['class'] == proxy_action_name }['output'])
63
63
  end
@@ -96,7 +96,7 @@ module ForemanTasks
96
96
  def correct_cronline
97
97
  ForemanTasks::RecurringLogic.new_from_cronline(cronline).next_occurrence_time
98
98
  rescue ArgumentError => _
99
- self.errors.add(:cronline, _("#{cronline} is not valid format of cronline"))
99
+ self.errors.add(:cronline, _("%s is not valid format of cron line")) % (cronline)
100
100
  end
101
101
  end
102
102
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  <table class="table table-fixed table-bordered table-striped table-condensed">
5
5
  <thead>
6
- <th><%= N_("Cronline") %></th>
6
+ <th><%= N_("Cron line") %></th>
7
7
  <th><%= N_("Task count") %></th>
8
8
  <th><%= N_("Action") %></th>
9
9
  <th><%= N_("Last occurrence") %></th>
@@ -19,7 +19,7 @@
19
19
  <td><%= link_to(recurring_logic.cron_line, foreman_tasks_recurring_logic_path(recurring_logic)) %></td>
20
20
  <td><%= link_to(recurring_logic.tasks.count, foreman_tasks_tasks_url(:search => "task_group.id = #{recurring_logic.task_group.id}")) %></td>
21
21
  <td><%= format_task_input(recurring_logic.tasks.first, true) %></td>
22
- <td><%= recurring_logic.tasks.order(:started_at).where('started_at IS NOT NULL').last.try(:started_at) || N_("-") %></td>
22
+ <td><%= recurring_logic.tasks.order(:started_at).where('started_at IS NOT NULL').last.try(:started_at) || "-" %></td>
23
23
  <td><%= recurring_logic_next_occurrence recurring_logic %></td>
24
24
  <td><%= recurring_logic.iteration %></td>
25
25
  <td><%= format_recurring_logic_limit recurring_logic.max_iteration %></td>
@@ -5,7 +5,7 @@
5
5
  <td><%= link_to(recurring_logic.id, recurring_logic) %></td>
6
6
  </tr>
7
7
  <tr>
8
- <th><%= N_("Cronline") %></th>
8
+ <th><%= N_("Cron line") %></th>
9
9
  <td><%= recurring_logic.cron_line %></td>
10
10
  </tr>
11
11
  <tr>
@@ -14,7 +14,7 @@
14
14
  </tr>
15
15
  <tr>
16
16
  <th><%= N_("Last occurrence") %></th>
17
- <td><%= recurring_logic.tasks.order(:started_at).where('started_at IS NOT NULL').last.try(:started_at) || N_('-') %></td>
17
+ <td><%= recurring_logic.tasks.order(:started_at).where('started_at IS NOT NULL').last.try(:started_at) || '-' %></td>
18
18
  </tr>
19
19
  <tr>
20
20
  <th><%= N_("Next occurrence") %></th>
@@ -1,4 +1,4 @@
1
- <h4><%= link_to _("Latest Warning/Error Tasks "), foreman_tasks_tasks_path(:order=>'started_at DESC') %></h4>
1
+ <h4><%= link_to _("Latest Warning/Error Tasks"), foreman_tasks_tasks_path(:order=>'started_at DESC') %></h4>
2
2
  <table class="table table-striped">
3
3
  <tr>
4
4
  <th><%= _("Name") %></th>
@@ -41,8 +41,6 @@ module ForemanTasks
41
41
  @world = world
42
42
 
43
43
  unless config.remote?
44
- at_exit { world.terminate.wait }
45
-
46
44
  # don't try to do any rescuing until the tables are properly migrated
47
45
  if !Foreman.in_rake?('db:migrate') && (ForemanTasks::Task.table_exists? rescue(false))
48
46
  world.auto_execute
@@ -1,3 +1,6 @@
1
+ require 'fast_gettext'
2
+ require 'gettext_i18n_rails'
3
+
1
4
  module ForemanTasks
2
5
  class Engine < ::Rails::Engine
3
6
  engine_name "foreman_tasks"
@@ -24,19 +27,28 @@ module ForemanTasks
24
27
  SETTINGS[:foreman_tasks] = { :assets => { :precompile => assets_to_precompile } }
25
28
  end
26
29
 
30
+ initializer 'foreman_tasks.register_gettext', :after => :load_config_initializers do
31
+ locale_dir = File.join(File.expand_path('../../..', __FILE__), 'locale')
32
+ locale_domain = 'foreman_tasks'
33
+
34
+ Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir
35
+ end
36
+
27
37
  initializer 'foreman_tasks.register_plugin', :after => :finisher_hook do |app|
28
38
  Foreman::Plugin.register :"foreman-tasks" do
29
39
  requires_foreman '>= 1.9.0'
30
- divider :top_menu, :parent => :monitor_menu, :after => :audits
40
+ divider :top_menu, :parent => :monitor_menu, :last => true
31
41
  menu :top_menu, :tasks,
32
42
  :url_hash => { :controller => 'foreman_tasks/tasks', :action => :index },
33
43
  :caption => N_('Tasks'),
34
- :parent => :monitor_menu
44
+ :parent => :monitor_menu,
45
+ :last => true
35
46
 
36
- menu :top_menu, :recurring_logics, :after => :tasks,
47
+ menu :top_menu, :recurring_logics,
37
48
  :url_hash => { :controller => 'foreman_tasks/recurring_logics', :action => :index },
38
49
  :caption => N_('Recurring logics'),
39
- :parent => :monitor_menu
50
+ :parent => :monitor_menu,
51
+ :last => true
40
52
 
41
53
  security_block :foreman_tasks do |map|
42
54
  permission :view_foreman_tasks, {:'foreman_tasks/tasks' => [:auto_complete_search, :sub_tasks, :index, :show],
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = "0.7.12"
2
+ VERSION = "0.7.13"
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.12
4
+ version: 0.7.13
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: 2016-02-08 00:00:00.000000000 Z
11
+ date: 2016-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynflow