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: 11345f1f98edc5fa4ac8b668621a0fa990234c15
4
- data.tar.gz: f1b379fdc8efbf91caefa1fcc5799b030754b85a
3
+ metadata.gz: 2f3f97f7067977ffca23c926e798efc4a29d240d
4
+ data.tar.gz: e2f771a0dcf32c7077bb1ac66bd0521f7d784713
5
5
  SHA512:
6
- metadata.gz: be3751c141bb852c3024f95ac6b3271eb1c4dc2e9fc152246c18527df70147b9e59304304ab2d22f10aa105f5ea6dff99506889a5156be208e65575349066553
7
- data.tar.gz: 603c15f190f327510c48b4022ae47555cacf336dfa4e988224b4902ef6453a18044aa1267f8380b59313e4cb49a43ec57225810631e487f0ea18ae1dad22f436
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
- # Dynflowize the action if we can, otherwise we'll do it live
26
- if defined? ForemanTasks
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
- if defined? ForemanTasks
4
- class ReportImport < Actions::EntryAction
5
- def resource_locks
6
- :report_import
7
- end
3
+ class ReportImport < Actions::EntryAction
4
+ def resource_locks
5
+ :report_import
6
+ end
8
7
 
9
- def plan(job, proxy_id)
10
- plan_self(:job_id => job[:job_id], :report => job[:result], :proxy_id => proxy_id)
11
- end
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
- def run
14
- ::User.as_anonymous_admin do
15
- reports = ::ForemanSalt::ReportImporter.import(input[:report], input[:proxy_id])
12
+ def run
13
+ ::User.as_anonymous_admin do
14
+ reports = ::ForemanSalt::ReportImporter.import(input[:report], input[:proxy_id])
16
15
 
17
- output[:state] = { :message => "Imported #{reports.count} new reports" }
18
- output[:hosts] = reports.map { |report| report.host.name }
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
- def humanized_name
23
- _("Process Highstate Report: #{input[:job_id]}")
24
- end
21
+ def humanized_name
22
+ _("Process Highstate Report: #{input[:job_id]}")
25
23
  end
26
24
  end
27
25
  end
@@ -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
- if defined? ForemanTasks
13
- initializer 'foreman_salt.require_dynflow', :before => 'foreman_tasks.initialize_dynflow' do |_app|
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
@@ -1,3 +1,3 @@
1
1
  module ForemanSalt
2
- VERSION = '2.0.1'
2
+ VERSION = '2.0.2'
3
3
  end
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.1
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-03 00:00:00.000000000 Z
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