katello-foreman-engine 0.0.11 → 0.0.12
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.
@@ -20,6 +20,8 @@ module KatelloForemanEngine
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def plan(changeset)
|
23
|
+
# demotion is handed by DistributionUnpublish action
|
24
|
+
return unless changeset.is_a? PromotionChangeset
|
23
25
|
changeset.affected_repos.each do |repo|
|
24
26
|
repo = repo.get_clone(changeset.environment)
|
25
27
|
plan_action(RepositoryChange, repo)
|
@@ -20,10 +20,7 @@ module KatelloForemanEngine
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def plan(repo)
|
23
|
-
if repo
|
24
|
-
# no distributions, no instalation media
|
25
|
-
plan_action(DistributionUnpublish, repo)
|
26
|
-
elsif(repo.unprotected)
|
23
|
+
if distribution = bootable_distribution(repo)
|
27
24
|
repo_info = {
|
28
25
|
'pulp_id' => repo.pulp_id,
|
29
26
|
'uri' => repo.uri,
|
@@ -37,15 +34,26 @@ module KatelloForemanEngine
|
|
37
34
|
repo_info['content_view_label'] = repo.content_view.label
|
38
35
|
end
|
39
36
|
|
40
|
-
# Foreman's installation media don't distinguish between
|
41
|
-
# different variants. Using just a first one.
|
42
|
-
distribution = repo.distributions.first
|
43
37
|
plan_action(DistributionPublish,
|
44
38
|
{ 'repo' => repo_info,
|
45
39
|
'family' => distribution.family,
|
46
40
|
'variant' => distribution.variant,
|
47
41
|
'arch' => distribution.arch,
|
48
42
|
'version' => distribution.version })
|
43
|
+
else
|
44
|
+
plan_action(DistributionUnpublish, repo)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def bootable_distribution(repo)
|
49
|
+
return unless repo.unprotected
|
50
|
+
# not every distribution from Pulp represents a bottable
|
51
|
+
# repo. Determine based on the files in there.
|
52
|
+
return repo.distributions.find do |distribution|
|
53
|
+
distribution.files.any? do |file|
|
54
|
+
file[:relativepath].include?("vmlinuz") ||
|
55
|
+
file[:relativepath].include?("pxeboot")
|
56
|
+
end
|
49
57
|
end
|
50
58
|
end
|
51
59
|
|
@@ -9,7 +9,8 @@ module KatelloForemanEngine
|
|
9
9
|
:distributions => [stub('family' => 'Family',
|
10
10
|
'variant' => 'Variant',
|
11
11
|
'arch' => 'Arch',
|
12
|
-
'version' => 'Version'
|
12
|
+
'version' => 'Version',
|
13
|
+
'files' => [{:relativepath => 'images/pxeboot/vmlinuz'}])],
|
13
14
|
:pulp_id => 'pulp_id',
|
14
15
|
:uri => 'https://example.com/repo/uri',
|
15
16
|
:label => 'label',
|
@@ -36,7 +37,7 @@ module KatelloForemanEngine
|
|
36
37
|
end
|
37
38
|
|
38
39
|
test "plans repository unpublish if no distros found for the repo" do
|
39
|
-
repo = stub(:distributions => [])
|
40
|
+
repo = stub(:unprotected => true, :distributions => [])
|
40
41
|
action_class, arg = planned_actions(RepositoryChange, {}, repo).first
|
41
42
|
assert_equal DistributionUnpublish, action_class
|
42
43
|
assert_equal repo, arg
|
metadata
CHANGED
@@ -1,54 +1,60 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: katello-foreman-engine
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 12
|
10
|
+
version: 0.0.12
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Katello
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-04-19 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: foreman_api
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: dynflow
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
33
25
|
none: false
|
34
|
-
requirements:
|
35
|
-
- -
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
38
33
|
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: dynflow
|
39
37
|
prerelease: false
|
40
|
-
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
39
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
46
49
|
description: Foreman specific parts in Katello
|
47
50
|
email: katello-devel@redhat.com
|
48
51
|
executables: []
|
52
|
+
|
49
53
|
extensions: []
|
54
|
+
|
50
55
|
extra_rdoc_files: []
|
51
|
-
|
56
|
+
|
57
|
+
files:
|
52
58
|
- Gemfile
|
53
59
|
- katello-foreman-engine.gemspec
|
54
60
|
- LICENSE
|
@@ -82,30 +88,39 @@ files:
|
|
82
88
|
- test/lib/actions/env_destroy_test.rb
|
83
89
|
- test/lib/actions/distribution_publish_test.rb
|
84
90
|
- test/lib/bindings_test.rb
|
91
|
+
has_rdoc: true
|
85
92
|
homepage: http://github.com/katello/katello-foreman-engine
|
86
|
-
licenses:
|
93
|
+
licenses:
|
87
94
|
- GPL-2
|
88
95
|
post_install_message:
|
89
96
|
rdoc_options: []
|
90
|
-
|
97
|
+
|
98
|
+
require_paths:
|
91
99
|
- lib
|
92
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
93
101
|
none: false
|
94
|
-
requirements:
|
95
|
-
- -
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
|
98
|
-
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 3
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
110
|
none: false
|
100
|
-
requirements:
|
101
|
-
- -
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
hash: 3
|
115
|
+
segments:
|
116
|
+
- 0
|
117
|
+
version: "0"
|
104
118
|
requirements: []
|
119
|
+
|
105
120
|
rubyforge_project:
|
106
|
-
rubygems_version: 1.
|
121
|
+
rubygems_version: 1.6.2
|
107
122
|
signing_key:
|
108
123
|
specification_version: 3
|
109
124
|
summary: Foreman specific parts of Katello
|
110
125
|
test_files: []
|
111
|
-
|
126
|
+
|