foreman_scc_manager 1.3.0 → 1.3.1
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 +4 -4
- data/app/controllers/scc_accounts_controller.rb +2 -2
- data/app/controllers/scc_products_controller.rb +1 -1
- data/app/models/scc_account.rb +14 -4
- data/db/migrate/20170221100619_create_scc_accounts.rb +1 -1
- data/db/migrate/20170227103408_create_scc_products.rb +1 -1
- data/db/migrate/20170301131641_create_scc_repositories.rb +1 -1
- data/db/migrate/20170301141330_create_scc_products_scc_repositories_join_table.rb +1 -1
- data/db/migrate/20170301163451_add_product_type_to_scc_product.rb +1 -1
- data/db/migrate/20170302082912_remove_repositories_from_scc_products.rb +1 -1
- data/db/migrate/20170302121542_create_scc_extendings.rb +1 -1
- data/db/migrate/20170303085304_add_organization_to_scc_account.rb +1 -1
- data/db/migrate/20170303131704_add_product_id_to_scc_product.rb +1 -1
- data/db/migrate/20170307092057_add_synced_to_scc_account.rb +1 -1
- data/db/migrate/20170418132648_add_name_to_scc_account.rb +1 -1
- data/db/migrate/20170505063726_add_sync_status_to_scc_account.rb +1 -1
- data/db/migrate/20180321000000_change_sync_status_to_sync_task.rb +1 -1
- data/lib/foreman_scc_manager/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd1877e55ef5915c8b11be58c142ee73292f450a0681cabfe0d4b0d410a977b3
|
4
|
+
data.tar.gz: 93678d164b05f4a4fa6a6f5a31ea17f43200acf071a0de58a8266e470b1c90ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6e11f9a75def00e1752330fcb7288081f1d2730ac6f0ae865b6ddb711ea545ccfd2db98094d9b71ba7d234669b2cb1491fd688dc34d4feca28cd1ad4bb11e5a
|
7
|
+
data.tar.gz: 4ff67012a62baf789859ccc57f9b450a49446e185dda4520c4ecac387b8b9755f69ffc30a43a93196d15500efc88b9ffd56627c56f2c4d698f881a6449c4cd41
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class SccAccountsController < ApplicationController
|
2
|
-
|
3
|
-
|
2
|
+
before_action :find_organization
|
3
|
+
before_action :find_resource, only: %i[show edit update destroy sync bulk_subscribe]
|
4
4
|
include Api::TaxonomyScope
|
5
5
|
include Foreman::Controller::AutoCompleteSearch
|
6
6
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class SccProductsController < ApplicationController
|
2
|
-
|
2
|
+
before_action :find_resource, only: %i[show subscribe unsubscribe]
|
3
3
|
include Api::TaxonomyScope
|
4
4
|
include Foreman::Controller::AutoCompleteSearch
|
5
5
|
|
data/app/models/scc_account.rb
CHANGED
@@ -64,8 +64,13 @@ class SccAccount < ApplicationRecord
|
|
64
64
|
end
|
65
65
|
# delete repositories beeing removed upstream (Active record seems to be wrong here...)
|
66
66
|
# scc_repositories.where.not(scc_id: upstream_repo_ids).delete_all
|
67
|
-
|
68
|
-
|
67
|
+
if upstream_repo_ids.empty?
|
68
|
+
urid_query_fragment = ''
|
69
|
+
else
|
70
|
+
upstream_repo_ids_str = upstream_repo_ids.map{ |id| ActiveRecord::Base.connection.quote(id) }.join(',')
|
71
|
+
urid_query_fragment = " and scc_repositories.scc_id not in (#{upstream_repo_ids_str})"
|
72
|
+
end
|
73
|
+
ActiveRecord::Base.connection.execute("delete from scc_repositories where scc_repositories.scc_account_id = #{ActiveRecord::Base.connection.quote(id)}#{urid_query_fragment};")
|
69
74
|
end
|
70
75
|
|
71
76
|
def update_scc_products(upstream_products)
|
@@ -86,8 +91,13 @@ class SccAccount < ApplicationRecord
|
|
86
91
|
end
|
87
92
|
# delete products beeing removed upstream (Active record seems to be wrong here...)
|
88
93
|
# scc_products.where.not(scc_id: upstream_product_ids).delete_all
|
89
|
-
|
90
|
-
|
94
|
+
if upstream_product_ids.empty?
|
95
|
+
upid_query_fragment = ''
|
96
|
+
else
|
97
|
+
upstream_product_ids_str = upstream_product_ids.map{ |id| ActiveRecord::Base.connection.quote(id) }.join(',')
|
98
|
+
upid_query_fragment = " and scc_products.scc_id not in (#{upstream_product_ids_str})"
|
99
|
+
end
|
100
|
+
ActiveRecord::Base.connection.execute("delete from scc_products where scc_products.scc_account_id = #{ActiveRecord::Base.connection.quote(id)}#{upid_query_fragment};")
|
91
101
|
# rewire product to product relationships
|
92
102
|
upstream_products.each do |up|
|
93
103
|
extensions = scc_products.where(scc_id: up['extensions'].map { |ext| ext['id'] })
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class CreateSccProductsSccRepositoriesJoinTable < ActiveRecord::Migration
|
1
|
+
class CreateSccProductsSccRepositoriesJoinTable < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_join_table :scc_products, :scc_repositories do |t|
|
4
4
|
# t.index [:scc_product_id, :scc_repository_id]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class AddProductIdToSccProduct < ActiveRecord::Migration
|
1
|
+
class AddProductIdToSccProduct < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
add_column :scc_products, :product_id, :integer, index: true, null: true
|
4
4
|
add_foreign_key :scc_products, :katello_products, column: :product_id, on_delete: :nullify
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_scc_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ATIX AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rubocop
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0.49'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0.49'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rdoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '4'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
-
type: :
|
47
|
+
version: '5.1'
|
48
|
+
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '5.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: foreman-tasks
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|