foreman_remote_execution 0.0.5 → 0.0.6
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 +4 -4
- data/app/models/job_template.rb +1 -0
- data/app/views/job_templates/index.html.erb +1 -1
- data/app/views/template_inputs/_form.html.erb +1 -1
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/test/unit/input_template_renderer_test.rb +5 -2
- data/test/unit/job_template_test.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8d8e0e19bc92e9e21f80c8a6e3e92be602746bf
|
4
|
+
data.tar.gz: 0b1fec43cafcb5cf997572113a54b581f715e465
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b10f8a9378e50fb25140a93a37141791f5080ee4f92027a005b1e68b8561fbc756d8780b90240f4bddd0cd50b38927f7ed849c94155ae59a3812341b0045dc2d
|
7
|
+
data.tar.gz: f0e678cf3bd185d40de34820c4d1e35cefc0d7429daedfff0d2440cb7744b49f97925259d74e1cf3743cb02492e7eedc916ca0e96d56543ae9d5055cf6d53f35
|
data/app/models/job_template.rb
CHANGED
@@ -8,6 +8,7 @@ class JobTemplate < ::Template
|
|
8
8
|
|
9
9
|
audited :allow_mass_assignment => true
|
10
10
|
has_many :audits, :as => :auditable, :class_name => Audited.audit_class.name
|
11
|
+
has_many :template_invocations, :dependent => :destroy, :foreign_key => 'template_id'
|
11
12
|
|
12
13
|
# these can't be shared in parent class, scoped search can't handle STI properly
|
13
14
|
# tested with scoped_search 3.2.0
|
@@ -5,7 +5,7 @@
|
|
5
5
|
remove_child_link('x', f, {:rel => 'twipsy', "data-title" => _('remove template input'), :'data-placement' => 'left', :class => 'fr badge badge-danger'}).html_safe do %>
|
6
6
|
<%= text_f f, :name %>
|
7
7
|
<%= checkbox_f f, :required %>
|
8
|
-
<%= selectable_f f, :input_type, template_input_types_options, {}, :class => 'input_type_selector' %>
|
8
|
+
<%= selectable_f f, :input_type, template_input_types_options, {}, :class => 'input_type_selector without_select2' %>
|
9
9
|
<div class="fact_input_type custom_input_type_fields" style="<%= f.object.fact_template_input? ? '' : 'display:none' %>">
|
10
10
|
<%= text_f f, :fact_name, :class => 'fact_input_type', :required => true %>
|
11
11
|
</div>
|
@@ -276,7 +276,8 @@ describe InputTemplateRenderer do
|
|
276
276
|
context 'with existing variable implemented as smart variable' do
|
277
277
|
let(:puppet_class) { FactoryGirl.create(:puppetclass, :environments => [environment], :hosts => [renderer.host]) }
|
278
278
|
let(:lookup_key) do
|
279
|
-
|
279
|
+
lookup_key_factory = SETTINGS[:version].short == '1.9' ? :lookup_key : :variable_lookup_key
|
280
|
+
FactoryGirl.create(lookup_key_factory,
|
280
281
|
:key => 'client_key',
|
281
282
|
:puppetclass => puppet_class,
|
282
283
|
:overrides => {"fqdn=#{renderer.host.fqdn}" => "RSA KEY"})
|
@@ -359,10 +360,12 @@ describe InputTemplateRenderer do
|
|
359
360
|
FactoryGirl.create(:puppetclass, :environments => [environment], :hosts => [renderer.host], :name => 'nginx')
|
360
361
|
end
|
361
362
|
let(:lookup_key) do
|
362
|
-
|
363
|
+
lookup_key_factory = SETTINGS[:version].short == '1.9' ? :lookup_key : :puppetclass_lookup_key
|
364
|
+
FactoryGirl.create(lookup_key_factory, :as_smart_class_param,
|
363
365
|
:key => 'version',
|
364
366
|
:puppetclass => puppet_class,
|
365
367
|
:path => 'fqdn',
|
368
|
+
:override => true,
|
366
369
|
:overrides => {"fqdn=#{renderer.host.fqdn}" => "1.4.7"})
|
367
370
|
end
|
368
371
|
|
@@ -51,4 +51,16 @@ describe JobTemplate do
|
|
51
51
|
template.default.must_equal true
|
52
52
|
end
|
53
53
|
end
|
54
|
+
|
55
|
+
context 'there is existing template invocation of a job template' do
|
56
|
+
let(:job_invocation) { FactoryGirl.create(:job_invocation, :with_template) }
|
57
|
+
let(:job_template) { job_invocation.template_invocations.first.template }
|
58
|
+
|
59
|
+
describe 'job template deletion' do
|
60
|
+
it 'succeeds' do
|
61
|
+
job_template.template_invocations.wont_be_empty
|
62
|
+
assert job_template.destroy
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
54
66
|
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: 0.0.
|
4
|
+
version: 0.0.6
|
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: 2015-09-
|
11
|
+
date: 2015-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|