foreman_remote_execution 3.3.4 → 3.3.5

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: af3cd3861fdf9ca798dff28f5da9441110f6442b9cb156604325c0c535dd7d27
4
- data.tar.gz: 24188a80f5231e8d15826d85322ff410a23bb62cded5a6ab5d30a87063eb8b85
3
+ metadata.gz: 6add16b63c650250f993954c92620863d9904055d4b175fa76b04b97dd70ee92
4
+ data.tar.gz: 7fca35b0b17e7f2ad0f5769fae4f56b0d5e6f0c85b9ebcc8abab29858bf585a5
5
5
  SHA512:
6
- metadata.gz: bdb4f63c31a63b4a54268f7fa36174cdf11ba90393159862370b29679d90a46ea5e0b8f86a0d98708166fa89fc0af0223dd4f93990fd0bc6e12c9dac473ab6e2
7
- data.tar.gz: 4c03fa3ead970d7817e00e884a32857a5a17ae1e41462e40db4057a57f4def05f04d6ad1a16829807a883482d3a684fe344b06e367c72a99cc13c1faacb7b673
6
+ metadata.gz: 359e21b88b85d45b1c4faef9a7e841b0c34e008d3e818c111eba4079167683ff6c59e1354f2f2aafc18e7be43c93c00c368eb9d331636d6c3103d6c59f637306
7
+ data.tar.gz: 17aa0693af9ec50fca1a97e4e685c914a665edfe78cf0d9a87b17a9c683490ad7b151748c36adb9b9bcb50389afaca533065d4590d23f2b7550eddad8017538c
@@ -80,6 +80,7 @@ module Api
80
80
  end
81
81
  composer.trigger!
82
82
  @job_invocation = composer.job_invocation
83
+ @hosts = @job_invocation.targeting.hosts
83
84
  process_response @job_invocation
84
85
  end
85
86
 
@@ -15,9 +15,13 @@ module ForemanRemoteExecution
15
15
  proxy = ::SmartProxy.find(proxy_id)
16
16
  begin
17
17
  proxy.drop_host_from_known_hosts(target)
18
- rescue RestClient::ResourceNotFound => e
19
- # ignore 404 when known_hosts entry is missing or the module was not enabled
20
- Foreman::Logging.exception "Proxy failed to delete SSH known_hosts for #{name}, #{ip}", e, :level => :error
18
+ rescue ::ProxyAPI::ProxyException => e
19
+ if e.wrapped_exception.is_a?(RestClient::NotFound)
20
+ # ignore 404 when known_hosts entry is missing or the module was not enabled
21
+ Foreman::Logging.exception "Proxy failed to delete SSH known_hosts for #{name}, #{ip}", e, :level => :error
22
+ else
23
+ raise e
24
+ end
21
25
  rescue => e
22
26
  Rails.logger.warn e.message
23
27
  return false
@@ -29,7 +33,10 @@ module ForemanRemoteExecution
29
33
  logger.debug "Scheduling SSH known_hosts cleanup"
30
34
 
31
35
  host, _kind, _target = host_kind_target
32
- proxies = host.remote_execution_proxies('SSH').values
36
+ # #remote_execution_proxies may not be defined on the host object in some case
37
+ # for example Host::Discovered does not have it defined, even though these hosts
38
+ # have Nic::Managed interfaces associated with them
39
+ proxies = (host.try(:remote_execution_proxies, 'SSH') || {}).values
33
40
  proxies.flatten.uniq.each do |proxy|
34
41
  queue.create(id: queue_id(proxy.id), name: _("Remove SSH known hosts for %s") % self,
35
42
  priority: 200, action: [self, :drop_from_known_hosts, proxy.id])
@@ -41,3 +41,9 @@
41
41
  <% end %>
42
42
  <%= render_tab_content_for(:main_tabs, subject: @job_invocation) %>
43
43
  </div>
44
+
45
+ <script id="job_invocation_refresh" data-refresh-url="<%= job_invocation_path(@job_invocation) %>">
46
+ <% if @auto_refresh %>
47
+ delayed_refresh($('script#job_invocation_refresh').data('refresh-url'), {});
48
+ <% end %>
49
+ </script>
@@ -0,0 +1,5 @@
1
+ $('div#title_action div.btn-group').html('<%= button_group(job_invocation_task_buttons(@job_invocation.task)).html_safe %>');
2
+
3
+ <% if @auto_refresh %>
4
+ delayed_refresh($('script#job_invocation_refresh').data('refresh-url'), job_invocation_refresh_data());
5
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module ForemanRemoteExecution
2
- VERSION = '3.3.4'.freeze
2
+ VERSION = '3.3.5'.freeze
3
3
  end
@@ -30,7 +30,7 @@ class SSHOrchestrationTest < ActiveSupport::TestCase
30
30
 
31
31
  it 'does not fail on 404 from the smart proxy' do
32
32
  host.stubs(:skip_orchestration?).returns false
33
- SmartProxy.any_instance.expects(:drop_host_from_known_hosts).raises(RestClient::ResourceNotFound).twice
33
+ ::ProxyAPI::RemoteExecutionSSH.any_instance.expects(:delete).raises(RestClient::ResourceNotFound).twice
34
34
  host.build = true
35
35
  host.save!
36
36
  ids = ["ssh_remove_known_hosts_interface_#{interface.ip}_#{proxy.id}",
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: 3.3.4
4
+ version: 3.3.5
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: 2020-07-20 00:00:00.000000000 Z
11
+ date: 2020-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -249,6 +249,7 @@ files:
249
249
  - app/views/job_invocations/new.html.erb
250
250
  - app/views/job_invocations/refresh.js.erb
251
251
  - app/views/job_invocations/show.html.erb
252
+ - app/views/job_invocations/show.js.erb
252
253
  - app/views/job_invocations/show.json.erb
253
254
  - app/views/job_invocations/welcome.html.erb
254
255
  - app/views/job_templates/_custom_tab_headers.html.erb