foreman_remote_execution 4.2.2 → 4.2.3

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: d1e8515b5c9b1bab6b31720b89e32c84c88c53c66d7c2aa03a67c7c961a3b2dd
4
- data.tar.gz: ee6b2f3c1d6f049b7035a0733db497748da3e6e23a24cf88bf7b915364513073
3
+ metadata.gz: 6a9f5c20b58b5911c612164cc806d63b3096c81506b18cd11423fb4b073bdec4
4
+ data.tar.gz: 2c8615b8ef06bf5d5adc3e62ab2a36906714ebe9e99adbf13dfb3eaa742819d6
5
5
  SHA512:
6
- metadata.gz: 7aa7420c1428d1f6dc0bbfa0612768432d5b082bd4fde74282f13f4dc040d635b68e5726cc8467d5c0d01f3f6299b528c71ab04223af16166f3b6a0308e05f35
7
- data.tar.gz: e1a0de0dd445f3b4a9ecd30feb4b51c356089a03d1b47250b5831867ed24cd44acb82143ad82c4775599a163c50213817af5747afa7ec38eec5f2d9819783752
6
+ metadata.gz: 549daa0a07ac47a7ed596187fd86943d9e1e517dab1d653af8f454ccee9e2b83fa85b6e2ec188201e5f849978b50b69108a0dbf6a6c67844b909de3b1b1e846f
7
+ data.tar.gz: b6e71fedfb385b05aa488fd65b68c2c242eba84783da007e26a6cf5f5b1b837de7bcbcfeecc72459b4c48cee93513f45948aa14318bbc548a52f159f2ae967cd
@@ -1,12 +1,16 @@
1
1
  <% items = [{ :caption => _('Job invocations'), :url => job_invocations_path },
2
2
  { :caption => @template_invocation.job_invocation.description,
3
- :url => job_invocation_path(@template_invocation.job_invocation_id) },
4
- { :caption => _('Template Invocation for %s') % @template_invocation.host.name }] %>
3
+ :url => job_invocation_path(@template_invocation.job_invocation_id) }]
5
4
 
6
- <% breadcrumbs(:resource_url => template_invocations_api_job_invocation_path(@template_invocation.job_invocation_id),
5
+ if @host
6
+ items << { :caption => _('Template Invocation for %s') % @host.name }
7
+ breadcrumbs(:resource_url => template_invocations_api_job_invocation_path(@template_invocation.job_invocation_id),
7
8
  :name_field => 'host_name',
8
9
  :switcher_item_url => template_invocation_path(':id'),
9
10
  :items => items)
11
+ else
12
+ breadcrumbs(items: items, switchable: false)
13
+ end
10
14
  %>
11
15
 
12
16
  <% stylesheet 'foreman_remote_execution/foreman_remote_execution' %>
@@ -18,31 +22,34 @@
18
22
  <%= button_group(link_to_function(_('Toggle command'), '$("div.preview").toggle()', :class => 'btn btn-default'),
19
23
  link_to_function(_('Toggle STDERR'), '$("div.line.stderr").toggle()', :class => 'btn btn-default'),
20
24
  link_to_function(_('Toggle STDOUT'), '$("div.line.stdout").toggle()', :class => 'btn btn-default'),
21
- link_to_function(_('Toggle DEBUG'), '$("div.line.debug").toggle()', :class => 'btn btn-default')) %>
25
+ link_to_function(_('Toggle DEBUG'), '$("div.line.debug").toggle()', :class => 'btn btn-default')) if @host %>
22
26
  <%= button_group(template_invocation_task_buttons(@template_invocation_task, @template_invocation.job_invocation)) %>
23
27
  </div>
24
28
  </div>
29
+ <% if @host %>
30
+ <h3><%= _('Target: ') %><%= link_to(@host.name, host_path(@host)) %></h3>
25
31
 
26
- <h3><%= _('Target: ') %><%= link_to(@host.name, host_path(@host)) %></h3>
27
-
28
- <div class="preview hidden">
29
- <%= preview_box(@template_invocation, @host) %>
30
- </div>
32
+ <div class="preview hidden">
33
+ <%= preview_box(@template_invocation, @host) %>
34
+ </div>
31
35
 
32
- <div class="terminal" data-refresh-url="<%= template_invocation_path(@template_invocation) %>">
33
- <% if @error %>
34
- <div class="line error"><%= @error %></div>
35
- <% else %>
36
- <%= link_to_function(_('Scroll to bottom'), '$("html, body").animate({ scrollTop: $(document).height() }, "slow");', :class => 'pull-right scroll-link-bottom') %>
36
+ <div class="terminal" data-refresh-url="<%= template_invocation_path(@template_invocation) %>">
37
+ <% if @error %>
38
+ <div class="line error"><%= @error %></div>
39
+ <% else %>
40
+ <%= link_to_function(_('Scroll to bottom'), '$("html, body").animate({ scrollTop: $(document).height() }, "slow");', :class => 'pull-right scroll-link-bottom') %>
37
41
 
38
- <div class="printable">
39
- <%= render :partial => 'output_line_set', :collection => normalize_line_sets(@line_sets) %>
40
- </div>
42
+ <div class="printable">
43
+ <%= render :partial => 'output_line_set', :collection => normalize_line_sets(@line_sets) %>
44
+ </div>
41
45
 
42
- <%= link_to_function(_('Scroll to top'), '$("html, body").animate({ scrollTop: 0 }, "slow");', :class => 'pull-right scroll-link-top') %>
43
- <% end %>
44
- </div>
46
+ <%= link_to_function(_('Scroll to top'), '$("html, body").animate({ scrollTop: 0 }, "slow");', :class => 'pull-right scroll-link-top') %>
47
+ <% end %>
48
+ </div>
45
49
 
46
- <script>
47
- <%= render :partial => 'refresh.js' %>
48
- </script>
50
+ <script>
51
+ <%= render :partial => 'refresh.js' %>
52
+ </script>
53
+ <% else %>
54
+ <%= _("Could not display data for job invocation.") %>
55
+ <% end %>
data/config/routes.rb CHANGED
@@ -56,6 +56,7 @@ Rails.application.routes.draw do
56
56
  post 'rerun'
57
57
  get 'template_invocations', :to => 'template_invocations#template_invocations'
58
58
  get 'outputs'
59
+ post 'outputs'
59
60
  end
60
61
  end
61
62
 
@@ -1,3 +1,3 @@
1
1
  module ForemanRemoteExecution
2
- VERSION = '4.2.2'.freeze
2
+ VERSION = '4.2.3'.freeze
3
3
  end
@@ -171,6 +171,16 @@ module Api
171
171
  assert_response :success
172
172
  end
173
173
 
174
+ test 'should provide outputs for selected hosts in the job' do
175
+ post :outputs, params: { :id => @invocation.id, :search_query => "id = #{@invocation.targeting.host_ids.first}" }, as: :json
176
+ result = ActiveSupport::JSON.decode(@response.body)
177
+ host_output = result['outputs'].first
178
+ assert_equal host_output['host_id'], @invocation.targeting.host_ids.first
179
+ assert_equal host_output['refresh'], true
180
+ assert_equal host_output['output'], []
181
+ assert_response :success
182
+ end
183
+
174
184
  test 'should provide outputs for hosts in the job matching a search query' do
175
185
  get :outputs, params: { :id => @invocation.id, :search_query => "name = definitely_not_in_the_job" }
176
186
  result = ActiveSupport::JSON.decode(@response.body)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_remote_execution
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.2
4
+ version: 4.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Remote Execution team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-13 00:00:00.000000000 Z
11
+ date: 2021-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface