foreman_salt 2.0.1 → 2.0.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f3f97f7067977ffca23c926e798efc4a29d240d
|
4
|
+
data.tar.gz: e2f771a0dcf32c7077bb1ac66bd0521f7d784713
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da42071ca83b47261517336c59ed9218d797169a3a4d142e36bfe6e423275bee81fca4d5f21886475b77ae79a182b695dad8e533c649e7fc16a6b5f0a0aaef03
|
7
|
+
data.tar.gz: 6b08a1effbccba43df1ea0721488ca8c28467468994f3b102bdbf14c8d8c6be14873710dfbe9a2d0e85623d8e3d211a90e9b4186390bc1e4094d744b65fad9c8
|
@@ -22,14 +22,8 @@ module ForemanSalt
|
|
22
22
|
Rails.logger.info("Processing job #{params[:job][:job_id]} from Salt.")
|
23
23
|
case params[:job][:function]
|
24
24
|
when 'state.highstate'
|
25
|
-
|
26
|
-
|
27
|
-
task = ForemanTasks.async_task(::Actions::ForemanSalt::ReportImport, params[:job], detected_proxy.try(:id))
|
28
|
-
render :json => { :task_id => task.id }
|
29
|
-
else
|
30
|
-
reports = ForemanSalt::ReportImporter.import(params[:job][:result], detected_proxy.try(:id))
|
31
|
-
render :json => { :message => "Imported #{reports.count} new reports." }
|
32
|
-
end
|
25
|
+
task = ForemanTasks.async_task(::Actions::ForemanSalt::ReportImport, params[:job], detected_proxy.try(:id))
|
26
|
+
render :json => { :task_id => task.id }
|
33
27
|
else
|
34
28
|
render :json => { :message => 'Unsupported function' }, :status => :unprocessable_entity
|
35
29
|
end
|
@@ -1,27 +1,25 @@
|
|
1
1
|
module Actions
|
2
2
|
module ForemanSalt
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
end
|
3
|
+
class ReportImport < Actions::EntryAction
|
4
|
+
def resource_locks
|
5
|
+
:report_import
|
6
|
+
end
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
def plan(job, proxy_id)
|
9
|
+
plan_self(:job_id => job[:job_id], :report => job[:result], :proxy_id => proxy_id)
|
10
|
+
end
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
def run
|
13
|
+
::User.as_anonymous_admin do
|
14
|
+
reports = ::ForemanSalt::ReportImporter.import(input[:report], input[:proxy_id])
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
end
|
16
|
+
output[:state] = { :message => "Imported #{reports.count} new reports" }
|
17
|
+
output[:hosts] = reports.map { |report| report.host.name }
|
20
18
|
end
|
19
|
+
end
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
end
|
21
|
+
def humanized_name
|
22
|
+
_("Process Highstate Report: #{input[:job_id]}")
|
25
23
|
end
|
26
24
|
end
|
27
25
|
end
|
data/lib/foreman_salt/engine.rb
CHANGED
@@ -9,10 +9,8 @@ module ForemanSalt
|
|
9
9
|
config.autoload_paths += Dir["#{config.root}/app/services"]
|
10
10
|
config.autoload_paths += Dir["#{config.root}/app/lib"]
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
ForemanTasks.dynflow.require!
|
15
|
-
end
|
12
|
+
initializer 'foreman_salt.require_dynflow', :before => 'foreman_tasks.initialize_dynflow' do |_app|
|
13
|
+
ForemanTasks.dynflow.require!
|
16
14
|
end
|
17
15
|
|
18
16
|
initializer 'foreman_salt.load_default_settings', :before => :load_config_initializers do
|
data/lib/foreman_salt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_salt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Benjamin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "<"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: foreman-tasks
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.6.9
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.6.9
|
27
41
|
description: Foreman Plug-in for Salt
|
28
42
|
email:
|
29
43
|
- stephen@redhat.com
|