foreman_remote_execution 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +28 -2
- data/.rubocop_todo.yml +0 -7
- data/Gemfile +1 -1
- data/app/controllers/api/v2/foreign_input_sets_controller.rb +1 -2
- data/app/controllers/api/v2/job_invocations_controller.rb +2 -2
- data/app/controllers/api/v2/job_templates_controller.rb +2 -3
- data/app/controllers/api/v2/remote_execution_features_controller.rb +1 -2
- data/app/controllers/api/v2/template_inputs_controller.rb +1 -2
- data/app/controllers/concerns/foreman/controller/parameters/job_template.rb +3 -3
- data/app/controllers/concerns/foreman/controller/parameters/template_input.rb +2 -2
- data/app/controllers/job_invocations_controller.rb +4 -7
- data/app/controllers/job_templates_controller.rb +2 -2
- data/app/controllers/remote_execution_features_controller.rb +1 -2
- data/app/helpers/remote_execution_helper.rb +22 -17
- data/app/lib/actions/remote_execution/run_host_job.rb +4 -10
- data/app/models/concerns/foreman_remote_execution/host_extensions.rb +29 -1
- data/app/models/host_status/execution_status.rb +1 -1
- data/app/models/input_template_renderer.rb +1 -1
- data/app/models/job_invocation.rb +12 -7
- data/app/models/job_invocation_composer.rb +15 -6
- data/app/models/job_invocation_task_group.rb +1 -1
- data/app/models/job_template.rb +45 -29
- data/app/models/job_template_importer.rb +21 -9
- data/app/models/remote_execution_feature.rb +4 -4
- data/app/models/setting/remote_execution.rb +7 -5
- data/app/models/ssh_execution_provider.rb +1 -3
- data/app/models/targeting.rb +6 -5
- data/app/models/template_invocation.rb +43 -1
- data/app/views/job_invocations/_form.html.erb +1 -1
- data/app/views/job_invocations/_tab_overview.html.erb +10 -1
- data/config/routes.rb +2 -2
- data/db/migrate/20150903192731_add_execution_to_interface.rb +6 -6
- data/db/migrate/20151215114631_add_host_id_to_template_invocation.rb +3 -2
- data/db/migrate/20160114120200_rename_job_categories.rb +1 -1
- data/db/migrate/20160127134031_add_advanced_to_template_input.rb +1 -1
- data/db/seeds.d/70-job_templates.rb +1 -1
- data/db/seeds.d/90-bookmarks.rb +1 -1
- data/doc/Gemfile +1 -1
- data/lib/foreman_remote_execution/engine.rb +1 -1
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/lib/tasks/foreman_remote_execution_tasks.rake +1 -1
- data/locale/action_names.rb +1 -1
- data/locale/de/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/de/foreman_remote_execution.po +39 -12
- data/locale/en/foreman_remote_execution.po +38 -11
- data/locale/en_GB/foreman_remote_execution.po +38 -11
- data/locale/es/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/es/foreman_remote_execution.po +39 -12
- data/locale/foreman_remote_execution.pot +175 -141
- data/locale/fr/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/fr/foreman_remote_execution.po +39 -12
- data/locale/ja/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/ja/foreman_remote_execution.po +39 -12
- data/locale/ko/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/ko/foreman_remote_execution.po +39 -12
- data/locale/pt_BR/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/pt_BR/foreman_remote_execution.po +39 -12
- data/locale/ru/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/ru/foreman_remote_execution.po +39 -12
- data/locale/zh_CN/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/zh_CN/foreman_remote_execution.po +39 -12
- data/locale/zh_TW/LC_MESSAGES/foreman_remote_execution.mo +0 -0
- data/locale/zh_TW/foreman_remote_execution.po +39 -12
- data/test/benchmark/run_hosts_job_benchmark.rb +2 -2
- data/test/benchmark/targeting_benchmark.rb +2 -2
- data/test/factories/foreman_remote_execution_factories.rb +27 -2
- data/test/functional/api/v2/job_templates_controller_test.rb +1 -1
- data/test/test_plugin_helper.rb +2 -19
- data/test/unit/concerns/host_extensions_test.rb +54 -5
- data/test/unit/concerns/nic_extensions_test.rb +1 -1
- data/test/unit/execution_task_status_mapper_test.rb +1 -2
- data/test/unit/input_template_renderer_test.rb +1 -1
- data/test/unit/job_invocation_composer_test.rb +21 -29
- data/test/unit/job_invocation_test.rb +1 -2
- data/test/unit/job_template_effective_user_test.rb +1 -1
- data/test/unit/job_template_importer_test.rb +38 -20
- data/test/unit/job_template_test.rb +8 -8
- data/test/unit/remote_execution_feature_test.rb +6 -6
- data/test/unit/remote_execution_provider_test.rb +2 -1
- data/test/unit/targeting_test.rb +6 -6
- data/test/unit/template_input_test.rb +1 -1
- data/test/unit/template_invocation_input_value_test.rb +3 -3
- metadata +3 -3
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_plugin_helper'
|
2
2
|
|
3
|
-
|
3
|
+
class RemoteExecutionProviderTest < ActiveSupport::TestCase
|
4
4
|
describe '.providers' do
|
5
5
|
let(:providers) { RemoteExecutionProvider.providers }
|
6
6
|
it { providers.must_be_kind_of HashWithIndifferentAccess }
|
@@ -13,6 +13,7 @@ describe RemoteExecutionProvider do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
describe '.register_provider' do
|
16
|
+
before { RemoteExecutionProvider.providers.delete(:new) }
|
16
17
|
let(:new_provider) { RemoteExecutionProvider.providers[:new] }
|
17
18
|
it { new_provider.must_be_nil }
|
18
19
|
|
data/test/unit/targeting_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_plugin_helper'
|
2
2
|
|
3
|
-
|
3
|
+
class TargetingTest < ActiveSupport::TestCase
|
4
4
|
let(:targeting) { FactoryGirl.build(:targeting) }
|
5
5
|
let(:bookmark) { bookmarks(:one) }
|
6
6
|
let(:host) { FactoryGirl.create(:host) }
|
@@ -88,10 +88,10 @@ describe Targeting do
|
|
88
88
|
context 'for two hosts' do
|
89
89
|
let(:query) { Targeting.build_query_from_hosts([ host.id, second_host.id ]) }
|
90
90
|
|
91
|
-
it 'builds query using host names joining
|
92
|
-
query.must_include
|
93
|
-
query.must_include
|
94
|
-
query.must_include '
|
91
|
+
it 'builds query using host names joining inside ^' do
|
92
|
+
query.must_include host.name
|
93
|
+
query.must_include second_host.name
|
94
|
+
query.must_include 'name ^'
|
95
95
|
|
96
96
|
Host.search_for(query).must_include host
|
97
97
|
Host.search_for(query).must_include second_host
|
@@ -102,7 +102,7 @@ describe Targeting do
|
|
102
102
|
let(:query) { Targeting.build_query_from_hosts([ host.id ]) }
|
103
103
|
|
104
104
|
it 'builds query using host name' do
|
105
|
-
query.must_equal "name
|
105
|
+
query.must_equal "name ^ (#{host.name})"
|
106
106
|
Host.search_for(query).must_include host
|
107
107
|
Host.search_for(query).wont_include second_host
|
108
108
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_plugin_helper'
|
2
2
|
|
3
|
-
|
3
|
+
class TemplateInvocationInputTest < ActiveSupport::TestCase
|
4
4
|
let(:template) { FactoryGirl.build(:job_template, :template => 'service restart <%= input("service_name") -%>') }
|
5
5
|
let(:renderer) { InputTemplateRenderer.new(template) }
|
6
6
|
let(:job_invocation) { FactoryGirl.create(:job_invocation) }
|
@@ -29,10 +29,10 @@ describe TemplateInvocationInputValue do
|
|
29
29
|
|
30
30
|
it 'supports large inputs' do
|
31
31
|
template.template_inputs << FactoryGirl.build(:template_input, :name => 'service_name',
|
32
|
-
|
32
|
+
:input_type => 'user', :required => true)
|
33
33
|
assert_valid FactoryGirl.create(:template_invocation_input_value,
|
34
34
|
:template_invocation => template_invocation,
|
35
35
|
:template_input => template.template_inputs.first,
|
36
|
-
:value => 'foreman' *
|
36
|
+
:value => 'foreman' * 1_000_000)
|
37
37
|
end
|
38
38
|
end
|
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: 1.3.
|
4
|
+
version: 1.3.1
|
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: 2017-
|
11
|
+
date: 2017-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -428,7 +428,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
428
428
|
version: '0'
|
429
429
|
requirements: []
|
430
430
|
rubyforge_project:
|
431
|
-
rubygems_version: 2.5
|
431
|
+
rubygems_version: 2.4.5
|
432
432
|
signing_key:
|
433
433
|
specification_version: 4
|
434
434
|
summary: A plugin bringing remote execution to the Foreman, completing the config
|