foreman_spacewalk 0.1.0 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d088219e7aacc2929db1a85c22791b29e9d191dbe45984ca0e38c3f07bab6aae
4
- data.tar.gz: 3a6d0f46bc245913676c9c32f6c98ffb5b705b8c4830cf6012816fb90b76b85c
3
+ metadata.gz: e64ef92f1ce27ee28db10bc71bb45d15b7f3bd37faffefc5c01e96897fc37758
4
+ data.tar.gz: 3fe0f445b7754b4e31e5964d224e7451c948655a872847cac2902eaa3b53e0a5
5
5
  SHA512:
6
- metadata.gz: '001259bd0035f8532ee507d4cbc15f8b35ca631201e592cf020bd1c92ff62ff7d7908952081b3335a1e0fb310ad7cde9f29b2171351087a439669f984b1e3a38'
7
- data.tar.gz: b1406dbdfc1dc8d6e6b7cecd3d281c49bcf74bec8d852572bc867add0f56c36bffdbd1b2c47bf27935bb4c382c451e480f5dfc066a50ef5ef89e82cc823331aa
6
+ metadata.gz: 5588ae30efdb48c895cf9813b2b6347db9d5616c93edd62fd0298e3a6d96cc71b105253b35724268d261cbf72460a64c8da024266e3e671aaa76cceef7acb066
7
+ data.tar.gz: b2fabe71d8446fedc9d78f8b946a0378299177d015e65d746a7bee6d7cbd40132555f006ebb25767a147c5ca8061a0ee6898b1e76d0429776d8a4768f985a9b6
data/README.md CHANGED
@@ -7,7 +7,8 @@ Spacewalk is an open source server management tool and downstream for RedHat Sat
7
7
 
8
8
  | Foreman Version | Plugin Version |
9
9
  | --------------- | -------------- |
10
- | >= 1.15 | any |
10
+ | >= 1.15 | ~> 0.1 |
11
+ | >= 1.17 | ~> 1.0 |
11
12
 
12
13
  ## Installation
13
14
 
@@ -2,18 +2,20 @@ module ForemanSpacewalk
2
2
  module HostsHelperExt
3
3
  extend ActiveSupport::Concern
4
4
 
5
- included do
6
- alias_method_chain :multiple_actions, :spacewalk
5
+ module Overrides
6
+ def multiple_actions
7
+ spacewalk_multiple_actions = []
8
+ if authorized_for(controller: :hosts, action: :select_multiple_downtime)
9
+ spacewalk_multiple_actions << [
10
+ _('Change Spacewalk Proxy'), select_multiple_spacewalk_proxy_hosts_path
11
+ ]
12
+ end
13
+ super + spacewalk_multiple_actions
14
+ end
7
15
  end
8
16
 
9
- def multiple_actions_with_spacewalk
10
- spacewalk_multiple_actions = []
11
- if authorized_for(controller: :hosts, action: :select_multiple_downtime)
12
- spacewalk_multiple_actions << [
13
- _('Change Spacewalk Proxy'), select_multiple_spacewalk_proxy_hosts_path
14
- ]
15
- end
16
- multiple_actions_without_spacewalk + spacewalk_multiple_actions
17
+ included do
18
+ prepend Overrides
17
19
  end
18
20
  end
19
21
  end
@@ -2,23 +2,23 @@ module ForemanSpacewalk
2
2
  module HostExtensions
3
3
  extend ActiveSupport::Concern
4
4
 
5
- included do
6
- include Orchestration::Spacewalk
7
-
8
- alias_method_chain :smart_proxy_ids, :spacewalk_proxy
9
- alias_method_chain :hostgroup_inherited_attributes, :spacewalk
10
- end
5
+ module Overrides
6
+ def hostgroup_inherited_attributes
7
+ super + ['spacewalk_proxy_id']
8
+ end
11
9
 
12
- def hostgroup_inherited_attributes_with_spacewalk
13
- hostgroup_inherited_attributes_without_spacewalk + ['spacewalk_proxy_id']
10
+ def smart_proxy_ids
11
+ ids = super
12
+ [spacewalk_proxy, hostgroup.try(:spacewalk_proxy)].compact.each do |proxy|
13
+ ids << proxy.id
14
+ end
15
+ ids
16
+ end
14
17
  end
15
18
 
16
- def smart_proxy_ids_with_spacewalk_proxy
17
- ids = smart_proxy_ids_without_spacewalk_proxy
18
- [spacewalk_proxy, hostgroup.try(:spacewalk_proxy)].compact.each do |proxy|
19
- ids << proxy.id
20
- end
21
- ids
19
+ included do
20
+ include Orchestration::Spacewalk
21
+ prepend Overrides
22
22
  end
23
23
  end
24
24
  end
@@ -1,4 +1,4 @@
1
- class AddSpacewalkProxyIdToHostAndHostgroup < ActiveRecord::Migration
1
+ class AddSpacewalkProxyIdToHostAndHostgroup < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :hosts, :spacewalk_proxy_id, :integer, index: true
4
4
  add_column :hostgroups, :spacewalk_proxy_id, :integer, index: true
@@ -15,7 +15,7 @@ module ForemanSpacewalk
15
15
 
16
16
  initializer 'foreman_spacewalk.register_plugin', before: :finisher_hook do |_app|
17
17
  Foreman::Plugin.register :foreman_spacewalk do
18
- requires_foreman '>= 1.15'
18
+ requires_foreman '>= 1.17'
19
19
 
20
20
  spacewalk_proxy_options = {
21
21
  feature: 'Spacewalk',
@@ -1,3 +1,3 @@
1
1
  module ForemanSpacewalk
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '1.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_spacewalk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Goebel