foreman_salt 8.0.3 → 8.0.4

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
- SHA1:
3
- metadata.gz: b41856693558fa791aa8995c9532ff5fc2c2aee7
4
- data.tar.gz: 4d74360561499d39ec1a340d542a3d8c54f5030c
2
+ SHA256:
3
+ metadata.gz: f6b102a6fc74aec003d945ca7d88f86963c673fc624e8867f84fd59ee061d778
4
+ data.tar.gz: a1a9409a364838b09777da3477e1037def275fe913544de8766ebd9b2a1d99c5
5
5
  SHA512:
6
- metadata.gz: a5f3c8092420d2671c6c05b27253cf45691a8ea9fbffad31c9d5bfa4d94c5decf31e4389c33c2b6b8fa99ef188b7fb52dbdc2e3fa5c73935a9e5cbf9e25cc21a
7
- data.tar.gz: a3d3f67166b6c124bf47a8d86b05ea286f6ad44251665e0b2057a31b54f79e5d0841285c5effa99bfd33d8f8e968f48b9a4d958abbdf85707f3cc2731ce54b82
6
+ metadata.gz: 8ad8328433e56b07411ee20fa88f7df325ab40bbd7ba4d2fca557bd8148260929e3027e71319d8f79bbc0795da33f122621a9fb9e13395020af100978e5331c7
7
+ data.tar.gz: 423f85d580b378fa4bb488bee0d917ed6aa7501dc84e3237a5111dc79f321f9ef15958e00243bfe93f3d0ef6f4b90eadc63e20cdcf621f9a27824dc38562cafa
@@ -21,7 +21,7 @@ module ForemanSalt
21
21
  param :smart_proxy_id, :identifier_dottable, :required => true
22
22
  param :state, String, :required => true, :desc => N_('State can be "accepted" or "rejected"')
23
23
  def update
24
- case params[:key][:state]
24
+ case params[:salt_key][:state]
25
25
  when 'accepted'
26
26
  @key.accept
27
27
  when 'rejected'
@@ -29,7 +29,7 @@ module ForemanSalt
29
29
  param_group :minion
30
30
  def update
31
31
  params[:minion][:salt_module_ids] = params[:minion].delete(:salt_state_ids) if params[:minion]
32
- process_response @salt_minion.update_attributes(params[:minion])
32
+ process_response @salt_minion.update_attributes(params.require(:minion).permit(:salt_proxy_id, :salt_environment_id, :salt_module_ids => []))
33
33
  end
34
34
 
35
35
  def controller_permission
@@ -66,7 +66,7 @@ module ForemanSalt
66
66
  end
67
67
  clean_orphans
68
68
  end
69
- render :text => states.to_json
69
+ render :plain => states.to_json
70
70
  end
71
71
 
72
72
  def controller_permission
@@ -16,12 +16,12 @@ module ForemanSalt
16
16
 
17
17
  enc['environment'] = env
18
18
  respond_to do |format|
19
- format.html { render :text => "<pre>#{ERB::Util.html_escape(enc.to_yaml)}</pre>" }
20
- format.yml { render :text => enc.to_yaml }
19
+ format.html { render :plain => "<pre>#{ERB::Util.html_escape(enc.to_yaml)}</pre>" }
20
+ format.yml { render :plain => enc.to_yaml }
21
21
  end
22
22
  rescue
23
23
  logger.warn "Failed to generate external nodes for #{@minion} with #{$ERROR_INFO}"
24
- render(:text => _('Unable to generate output, Check log files\n'), :status => 412) && return
24
+ render(:plain => _('Unable to generate output, Check log files\n'), :status => 412) && return
25
25
  end
26
26
 
27
27
  def run
@@ -4,8 +4,8 @@ module ForemanSalt
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  included do
7
- has_many :salt_modules, :through => :host_salt_modules, :class_name => '::ForemanSalt::SaltModule'
8
7
  has_many :host_salt_modules, :foreign_key => :host_id, :class_name => '::ForemanSalt::HostSaltModule'
8
+ has_many :salt_modules, :through => :host_salt_modules, :class_name => '::ForemanSalt::SaltModule'
9
9
 
10
10
  belongs_to :salt_proxy, :class_name => 'SmartProxy'
11
11
  belongs_to :salt_environment, :class_name => 'ForemanSalt::SaltEnvironment'
@@ -4,8 +4,8 @@ module ForemanSalt
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  included do
7
- has_many :salt_modules, :through => :hostgroup_salt_modules, :class_name => '::ForemanSalt::SaltModule'
8
7
  has_many :hostgroup_salt_modules, :class_name => '::ForemanSalt::HostgroupSaltModule'
8
+ has_many :salt_modules, :through => :hostgroup_salt_modules, :class_name => '::ForemanSalt::SaltModule'
9
9
 
10
10
  belongs_to :salt_proxy, :class_name => 'SmartProxy'
11
11
  belongs_to :salt_environment, :class_name => 'ForemanSalt::SaltEnvironment'
@@ -7,8 +7,8 @@ module ForemanSalt
7
7
  has_many :hosts, :class_name => '::Host::Managed'
8
8
  has_many :hostgroups, :class_name => '::Hostgroup'
9
9
 
10
- has_many :salt_modules, :through => :salt_module_environments, :before_remove => :remove_from_hosts
11
10
  has_many :salt_module_environments
11
+ has_many :salt_modules, :through => :salt_module_environments, :before_remove => :remove_from_hosts
12
12
 
13
13
  validates :name, :uniqueness => true, :presence => true, :format => { :with => /\A[\w\d\.]+\z/, :message => N_('is alphanumeric and cannot contain spaces') }
14
14
 
@@ -4,14 +4,14 @@ module ForemanSalt
4
4
  extend FriendlyId
5
5
  friendly_id :name
6
6
 
7
- has_many :hosts, :through => :host_salt_modules, :class_name => '::Host::Managed'
8
7
  has_many :host_salt_modules, :foreign_key => :salt_module_id
8
+ has_many :hosts, :through => :host_salt_modules, :class_name => '::Host::Managed'
9
9
 
10
- has_many :hostgroups, :through => :hostgroup_salt_modules
11
10
  has_many :hostgroup_salt_modules, :foreign_key => :salt_module_id
11
+ has_many :hostgroups, :through => :hostgroup_salt_modules
12
12
 
13
- has_many :salt_environments, :through => :salt_module_environments
14
13
  has_many :salt_module_environments
14
+ has_many :salt_environments, :through => :salt_module_environments
15
15
 
16
16
  validates :name, :uniqueness => true, :presence => true, :format => { :with => /\A(?:[\w\d\-]+\.{0,1})+[^\.]\z/, :message => N_('must be alphanumeric, can contain periods, dashes, underscores and must not contain spaces') }
17
17
 
@@ -31,14 +31,12 @@ module ForemanSalt
31
31
  end
32
32
 
33
33
  def accept
34
- fail ::Foreman::Exception.new(N_('unable to re-accept an accepted key')) unless state == 'unaccepted'
35
34
  proxy = SmartProxy.find(smart_proxy_id)
36
35
  Rails.cache.delete("saltkeys_#{proxy.id}") if Rails.env.production?
37
36
  ProxyAPI::Salt.new(:url => proxy.url).key_accept name
38
37
  end
39
38
 
40
39
  def reject
41
- fail ::Foreman::Exception.new(N_('unable to reject an accepted key')) unless state == 'unaccepted'
42
40
  proxy = SmartProxy.find(smart_proxy_id)
43
41
  Rails.cache.delete("saltkeys_#{proxy.id}") if Rails.env.production?
44
42
  ProxyAPI::Salt.new(:url => proxy.url).key_reject name
@@ -1,3 +1,3 @@
1
1
  module ForemanSalt
2
- VERSION = '8.0.3'
2
+ VERSION = '8.0.4'
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: 8.0.3
4
+ version: 8.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Benjamin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-25 00:00:00.000000000 Z
11
+ date: 2018-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -183,14 +183,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  requirements: []
185
185
  rubyforge_project:
186
- rubygems_version: 2.5.2.1
186
+ rubygems_version: 2.7.6
187
187
  signing_key:
188
188
  specification_version: 4
189
189
  summary: Foreman Plug-in for Salt
190
190
  test_files:
191
191
  - test/factories/foreman_salt_factories.rb
192
- - test/functional/api/v2/salt_environments_controller_test.rb
193
192
  - test/functional/api/v2/salt_autosign_controller_test.rb
193
+ - test/functional/api/v2/salt_environments_controller_test.rb
194
194
  - test/functional/api/v2/salt_keys_controller_test.rb
195
195
  - test/functional/api/v2/salt_states_controller_test.rb
196
196
  - test/functional/minions_controller_test.rb