katello 3.11.0 → 3.11.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/v2/organizations_controller.rb +2 -1
- data/app/controllers/katello/api/v2/products_controller.rb +6 -4
- data/app/lib/actions/katello/host/erratum/install.rb +1 -1
- data/app/lib/actions/katello/host/package/install.rb +1 -1
- data/app/lib/actions/katello/host/package/remove.rb +1 -1
- data/app/lib/actions/katello/host/package/update.rb +10 -2
- data/app/lib/actions/katello/host/package_group/install.rb +1 -1
- data/app/lib/actions/katello/host/package_group/remove.rb +1 -1
- data/app/lib/actions/pulp/abstract_async_task.rb +1 -1
- data/app/lib/actions/pulp/consumer/abstract_content_action.rb +2 -0
- data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
- data/app/lib/katello/util/path_with_substitutions.rb +1 -18
- data/app/models/katello/concerns/redhat_extensions.rb +3 -7
- data/app/models/katello/erratum.rb +1 -1
- data/app/models/katello/ostree_branch.rb +1 -3
- data/app/models/katello/ping.rb +17 -10
- data/app/models/katello/root_repository.rb +9 -1
- data/app/models/katello/sync_plan.rb +1 -31
- data/app/services/katello/pulp/repository/yum.rb +2 -2
- data/app/views/katello/api/v2/ostree_branches/show.json.rabl +1 -1
- data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
- data/app/views/katello/api/v2/subscriptions/manifest_history.json.rabl +1 -1
- data/app/views/katello/api/v2/sync_plans/show.json.rabl +1 -5
- data/db/migrate/20190326145039_remove_version_date_from_ostree_branch.rb +5 -0
- data/db/seeds.d/111-upgrade_tasks.rb +3 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-ostree.html +0 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-info.html +0 -3
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +2 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ostree-branches.html +0 -4
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details-info.controller.js +9 -2
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +1 -1
- data/lib/katello/tasks/upgrades/3.8/clear_checksum_type.rake +12 -0
- data/lib/katello/version.rb +1 -1
- data/webpack/components/SelectOrg/SelectOrgAction.js +1 -1
- data/webpack/components/SelectOrg/SetOrganization.js +4 -4
- data/webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap +159 -25
- data/webpack/components/WithOrganization/withOrganization.js +17 -2
- data/webpack/components/WithOrganization/withOrganization.test.js +6 -2
- data/webpack/redux/actions/RedHatRepositories/__tests__/helpers.test.js +13 -0
- data/webpack/redux/actions/RedHatRepositories/helpers.js +9 -0
- data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +2 -0
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +4 -2
- data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/__test__/RepositorySetRepository.test.js +1 -1
- data/webpack/scenes/RedHatRepositories/components/SearchBar.js +1 -1
- data/webpack/scenes/Subscriptions/SubscriptionReducer.js +1 -0
- data/webpack/scenes/Subscriptions/SubscriptionsPage.js +12 -3
- data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
- data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +28 -0
- data/webpack/scenes/Subscriptions/index.js +2 -2
- metadata +10 -3
- data/app/views/katello/sync_management/_sync_plans.html.erb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9cf1e3fb4076039f50b51d4f980f244ffb5734c57a81e3333573368e2bd6d3b
|
4
|
+
data.tar.gz: 83cf29642598dca1622d0813e607a377a220ec87f85cc54ff9783b3cec488bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48c26149a3886a3f02ec6abeda2706c195958254fb4751078fddcf7187613badadfff71328fc19570bae5e79dbf85250978cfca8fb902fd3124bea1071c7e871
|
7
|
+
data.tar.gz: 1b01c2da357fcdf719a6207854df618c1bb7654832a06612abc084a718661e3388e52a27d85a40e730811c7f3f1e100ed2286642c951afbf6faa2e51ec45b0c4
|
@@ -80,7 +80,8 @@ module Katello
|
|
80
80
|
@organization.reload
|
81
81
|
respond_for_create :resource => @organization
|
82
82
|
rescue => e
|
83
|
-
|
83
|
+
::Foreman::Logging.exception('Could not create organization', e)
|
84
|
+
process_resource_error(message: e.message, resource: @organization)
|
84
85
|
end
|
85
86
|
|
86
87
|
api :DELETE, '/organizations/:id', N_('Delete an organization')
|
@@ -33,8 +33,9 @@ module Katello
|
|
33
33
|
param :organization_id, :number, :desc => N_("Filter products by organization"), :required => true
|
34
34
|
param :subscription_id, :number, :desc => N_("Filter products by subscription")
|
35
35
|
param :name, String, :desc => N_("Filter products by name")
|
36
|
-
param :enabled, :bool, :desc => N_("
|
37
|
-
param :custom, :bool, :desc => N_("
|
36
|
+
param :enabled, :bool, :desc => N_("Return enabled products only")
|
37
|
+
param :custom, :bool, :desc => N_("Return custom products only")
|
38
|
+
param :redhat_only, :bool, :desc => N_("Return Red Hat (non-custom) products only")
|
38
39
|
param :include_available_content, :bool, :desc => N_("Whether to include available content attribute in results")
|
39
40
|
param :sync_plan_id, :number, :desc => N_("Filter products by sync plan id")
|
40
41
|
param :available_for, String, :desc => N_("Interpret specified object to return only Products that can be associated with specified object. Only 'sync_plan' is supported."),
|
@@ -47,9 +48,10 @@ module Katello
|
|
47
48
|
|
48
49
|
def index_relation
|
49
50
|
query = Product.readable.where(:organization_id => @organization.id)
|
50
|
-
query = query.
|
51
|
+
query = query.custom if ::Foreman::Cast.to_bool params[:custom]
|
52
|
+
query = query.redhat if ::Foreman::Cast.to_bool params[:redhat_only]
|
51
53
|
query = query.where(:name => params[:name]) if params[:name]
|
52
|
-
query = query.enabled if params[:enabled]
|
54
|
+
query = query.enabled if ::Foreman::Cast.to_bool params[:enabled]
|
53
55
|
query = query.where(:id => @activation_key.products) if @activation_key
|
54
56
|
|
55
57
|
if params[:subscription_id]
|
@@ -43,7 +43,7 @@ module Actions
|
|
43
43
|
|
44
44
|
def finalize
|
45
45
|
host = ::Host.find_by(:id => input[:host_id])
|
46
|
-
host.update(audit_comment: _("Installation of errata requested: %{errata}") % {errata: input[:errata].join(", ")})
|
46
|
+
host.update(audit_comment: (_("Installation of errata requested: %{errata}") % {errata: input[:errata].join(", ")}).truncate(255))
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -34,7 +34,7 @@ module Actions
|
|
34
34
|
|
35
35
|
def finalize
|
36
36
|
host = ::Host.find_by(:id => input[:host_id])
|
37
|
-
host.update(audit_comment: _("Installation of package(s) requested: %{packages}") % {packages: input[:packages].join(", ")})
|
37
|
+
host.update(audit_comment: (_("Installation of package(s) requested: %{packages}") % {packages: input[:packages].join(", ")}).truncate(255))
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
@@ -47,7 +47,7 @@ module Actions
|
|
47
47
|
|
48
48
|
def finalize
|
49
49
|
host = ::Host.find_by(:id => input[:host_id])
|
50
|
-
host.update(audit_comment: _("Removal of package(s) requested: %{packages}") % {packages: input[:packages].join(", ")})
|
50
|
+
host.update(audit_comment: (_("Removal of package(s) requested: %{packages}") % {packages: input[:packages].join(", ")}).truncate(255))
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -21,7 +21,7 @@ module Actions
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def humanized_input
|
24
|
-
[(input[:packages] && input[:packages].join(", ") || "all packages")] + super
|
24
|
+
[(input[:packages].present? && input[:packages].join(", ") || "all packages")] + super
|
25
25
|
end
|
26
26
|
|
27
27
|
def presenter
|
@@ -34,7 +34,15 @@ module Actions
|
|
34
34
|
|
35
35
|
def finalize
|
36
36
|
host = ::Host.find_by(:id => input[:host_id])
|
37
|
-
host.update(audit_comment:
|
37
|
+
host.update(audit_comment: audit_comment)
|
38
|
+
end
|
39
|
+
|
40
|
+
def audit_comment
|
41
|
+
if input[:packages].present?
|
42
|
+
(_("Update of package(s) requested: %{packages}") % {packages: input[:packages].join(", ")}).truncate(255)
|
43
|
+
else
|
44
|
+
_("Update of all packages requested")
|
45
|
+
end
|
38
46
|
end
|
39
47
|
end
|
40
48
|
end
|
@@ -34,7 +34,7 @@ module Actions
|
|
34
34
|
|
35
35
|
def finalize
|
36
36
|
host = ::Host.find_by(:id => input[:host_id])
|
37
|
-
host.update(audit_comment: _("Installation of package group(s) requested: %{groups}") % {groups: input[:groups].join(", ")})
|
37
|
+
host.update(audit_comment: (_("Installation of package group(s) requested: %{groups}") % {groups: input[:groups].join(", ")}).truncate(255))
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
@@ -33,7 +33,7 @@ module Actions
|
|
33
33
|
|
34
34
|
def finalize
|
35
35
|
host = ::Host.find_by(:id => input[:host_id])
|
36
|
-
host.update(audit_comment: _("Removal of package group(s) requested: %{groups}") % {groups: input[:groups].join(", ")})
|
36
|
+
host.update(audit_comment: (_("Removal of package group(s) requested: %{groups}") % {groups: input[:groups].join(", ")}).truncate(255))
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -47,6 +47,8 @@ module Actions
|
|
47
47
|
# by default runcible puts whatever we pass into a hash under the 'name' key
|
48
48
|
# here we can make the unit hash more precise
|
49
49
|
def parse_units_for_type
|
50
|
+
return unless input[:args]
|
51
|
+
|
50
52
|
if input[:type] == 'rpm'
|
51
53
|
input[:args].collect do |unit|
|
52
54
|
::Katello::Util::Package.parse_nvrea_nvre(unit) || unit
|
@@ -7,7 +7,7 @@ module Katello
|
|
7
7
|
def kickstart_attributes
|
8
8
|
super
|
9
9
|
|
10
|
-
medium_provider = Katello::ManagedContentMediumProvider.new(host
|
10
|
+
medium_provider = Katello::ManagedContentMediumProvider.new(host)
|
11
11
|
content_view = host.try(:content_facet).try(:content_view) || host.try(:content_view)
|
12
12
|
|
13
13
|
if content_view && host.operatingsystem.is_a?(Redhat) &&
|
@@ -1,8 +1,6 @@
|
|
1
1
|
module Katello
|
2
2
|
module Util
|
3
3
|
class PathWithSubstitutions
|
4
|
-
ARCHITECTURES = ["x86_64", "s390x", "ppc64le", "aarch64", "multiarch", "ppc64"].freeze
|
5
|
-
|
6
4
|
include Comparable
|
7
5
|
|
8
6
|
attr_accessor :substitutions
|
@@ -14,27 +12,12 @@ module Katello
|
|
14
12
|
@substitutions = substitutions
|
15
13
|
@path = path
|
16
14
|
@resolved = []
|
17
|
-
check_for_subs_in_path if no_base_arch_passed?
|
18
|
-
end
|
19
|
-
|
20
|
-
def no_base_arch_passed?
|
21
|
-
@substitutions.keys.exclude?("basearch") && substitutions_needed.exclude?("basearch")
|
22
|
-
end
|
23
|
-
|
24
|
-
def split_path
|
25
|
-
@split ||= @path.split('/').map(&:downcase).reject(&:blank?)
|
26
|
-
end
|
27
|
-
|
28
|
-
def check_for_subs_in_path
|
29
|
-
arches = split_path & ARCHITECTURES
|
30
|
-
arch = arches.first
|
31
|
-
@substitutions["basearch"] = arch if arch
|
32
15
|
end
|
33
16
|
|
34
17
|
def substitutions_needed
|
35
18
|
# e.g. if content_url = "/content/dist/rhel/server/7/$releasever/$basearch/kickstart"
|
36
19
|
# return ['releasever', 'basearch']
|
37
|
-
|
20
|
+
path.split('/').map { |word| word.start_with?('$') ? word[1..-1] : nil }.compact
|
38
21
|
end
|
39
22
|
|
40
23
|
def substitutable?
|
@@ -41,11 +41,7 @@ module Katello
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def kickstart_repos(host)
|
44
|
-
|
45
|
-
|
46
|
-
return [] if distribution_repos.empty?
|
47
|
-
|
48
|
-
distros = distribution_repos.where(distribution_bootable: true)
|
44
|
+
distros = distribution_repositories(host).where(distribution_bootable: true)
|
49
45
|
if distros && host.content_source
|
50
46
|
distros.map { |distro| distro.to_hash(host.content_source) }
|
51
47
|
else
|
@@ -55,7 +51,7 @@ module Katello
|
|
55
51
|
|
56
52
|
def variant_repo(host, variant)
|
57
53
|
if variant && host.content_source
|
58
|
-
product_id = host
|
54
|
+
product_id = host.try(:content_facet).try(:kickstart_repository).try(:product_id) || host.try(:kickstart_repository).try(:product_id)
|
59
55
|
distro = distribution_repositories(host)
|
60
56
|
.joins(:product)
|
61
57
|
.where(
|
@@ -76,7 +72,7 @@ module Katello
|
|
76
72
|
where("#{Katello::Repository.table_name}.distribution_version = :release or #{Katello::Repository.table_name}.distribution_version like :match",
|
77
73
|
release: host.os.release, match: "#{host.os.release}.%")
|
78
74
|
else
|
79
|
-
|
75
|
+
Katello::Repository.none
|
80
76
|
end
|
81
77
|
end
|
82
78
|
end
|
@@ -86,7 +86,7 @@ module Katello
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def hosts_available(org_id = nil)
|
89
|
-
self.hosts_applicable(org_id).joins("INNER JOIN #{Katello::RepositoryErratum.table_name} on \
|
89
|
+
self.hosts_applicable(org_id).distinct.joins("INNER JOIN #{Katello::RepositoryErratum.table_name} on \
|
90
90
|
#{Katello::RepositoryErratum.table_name}.erratum_id = #{self.id}").joins(:content_facet_repositories).
|
91
91
|
where("#{Katello::ContentFacetRepository.table_name}.repository_id = #{Katello::RepositoryErratum.table_name}.repository_id")
|
92
92
|
end
|
@@ -9,7 +9,6 @@ module Katello
|
|
9
9
|
scoped_search :on => :version, :complete_value => true
|
10
10
|
scoped_search :on => :commit, :complete_value => true
|
11
11
|
scoped_search :on => :pulp_id, :complete_value => true, :rename => :uuid
|
12
|
-
scoped_search :on => :version_date, :complete_value => true, :rename => :created
|
13
12
|
|
14
13
|
CONTENT_TYPE = Pulp::OstreeBranch::CONTENT_TYPE
|
15
14
|
|
@@ -20,8 +19,7 @@ module Katello
|
|
20
19
|
def update_from_json(json)
|
21
20
|
update_attributes(:name => json[:branch],
|
22
21
|
:version => json[:metadata][:version],
|
23
|
-
:commit => json[:commit]
|
24
|
-
:version_date => json[:_created].to_datetime
|
22
|
+
:commit => json[:commit]
|
25
23
|
)
|
26
24
|
end
|
27
25
|
end
|
data/app/models/katello/ping.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
#:nocov:
|
2
|
-
|
3
1
|
module Katello
|
4
2
|
class Ping
|
5
3
|
OK_RETURN_CODE = 'ok'.freeze
|
@@ -40,7 +38,8 @@ module Katello
|
|
40
38
|
def ping_candlepin_without_auth(service_result)
|
41
39
|
url = SETTINGS[:katello][:candlepin][:url]
|
42
40
|
exception_watch(service_result) do
|
43
|
-
backend_status(url, :candlepin)
|
41
|
+
status = backend_status(url, :candlepin)
|
42
|
+
check_candlepin_status(status)
|
44
43
|
end
|
45
44
|
end
|
46
45
|
|
@@ -56,7 +55,8 @@ module Katello
|
|
56
55
|
|
57
56
|
def ping_candlepin_with_auth(service_result)
|
58
57
|
exception_watch(service_result) do
|
59
|
-
Katello::Resources::Candlepin::CandlepinPing.ping
|
58
|
+
status = Katello::Resources::Candlepin::CandlepinPing.ping
|
59
|
+
check_candlepin_status(status)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -77,16 +77,24 @@ module Katello
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
+
def check_candlepin_status(status)
|
81
|
+
if status[:mode] != 'NORMAL'
|
82
|
+
fail _("Candlepin is not running properly")
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
80
86
|
# check for exception - set the result code properly
|
81
87
|
def exception_watch(result)
|
82
88
|
start = Time.new
|
83
89
|
yield
|
84
90
|
result[:status] = OK_RETURN_CODE
|
85
91
|
result[:duration_ms] = ((Time.new - start) * 1000).round.to_s
|
92
|
+
result
|
86
93
|
rescue => e
|
87
94
|
Rails.logger.warn(e.backtrace ? [e.message, e.backtrace].join("\n") : e.message)
|
88
95
|
result[:status] = FAIL_RETURN_CODE
|
89
96
|
result[:message] = e.message
|
97
|
+
result
|
90
98
|
end
|
91
99
|
|
92
100
|
# get package information for katello and its components
|
@@ -111,10 +119,9 @@ module Katello
|
|
111
119
|
# because it returns empty string, which is not enough to say
|
112
120
|
# pulp is the one that responded
|
113
121
|
def pulp_without_auth(url)
|
114
|
-
|
122
|
+
json = backend_status(url, :pulp)
|
115
123
|
|
116
|
-
fail _("Pulp does not appear to be running at %s.") % url if
|
117
|
-
json = JSON.parse(body)
|
124
|
+
fail _("Pulp does not appear to be running at %s.") % url if json.empty?
|
118
125
|
|
119
126
|
if json['database_connection'] && json['database_connection']['connected'] != true
|
120
127
|
fail _("Pulp database connection issue at %s.") % url
|
@@ -148,10 +155,10 @@ module Katello
|
|
148
155
|
options[:ssl_ca_file] = ca_file unless ca_file.nil?
|
149
156
|
options[:verify_ssl] = SETTINGS[:katello][backend][:verify_ssl] if SETTINGS[:katello][backend].key?(:verify_ssl)
|
150
157
|
client = RestClient::Resource.new("#{url}/status", options)
|
151
|
-
|
158
|
+
|
159
|
+
response = client.get
|
160
|
+
response.empty? ? {} : JSON.parse(response).with_indifferent_access
|
152
161
|
end
|
153
162
|
end
|
154
163
|
end
|
155
164
|
end
|
156
|
-
|
157
|
-
#:nocov:
|
@@ -50,6 +50,7 @@ module Katello
|
|
50
50
|
validate :ensure_valid_docker_tags_whitelist
|
51
51
|
validate :ensure_content_attribute_restrictions
|
52
52
|
validate :ensure_valid_upstream_authorization
|
53
|
+
validate :ensure_no_checksum_on_demand
|
53
54
|
validates :url, presence: true, if: :ostree?
|
54
55
|
validates :checksum_type, :inclusion => {:in => CHECKSUM_TYPES}, :allow_blank => true
|
55
56
|
validates :product_id, :presence => true
|
@@ -129,6 +130,12 @@ module Katello
|
|
129
130
|
end
|
130
131
|
end
|
131
132
|
|
133
|
+
def ensure_no_checksum_on_demand
|
134
|
+
if checksum_type.present? && ::Runcible::Models::YumImporter::DOWNLOAD_ON_DEMAND == download_policy
|
135
|
+
errors.add(:checksum_type, _("Checksum type cannot be set for yum repositories with on demand download policy."))
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
132
139
|
def ensure_ostree_repo_protected
|
133
140
|
if unprotected
|
134
141
|
errors.add(:base, _("OSTree Repositories cannot be unprotected."))
|
@@ -247,7 +254,8 @@ module Katello
|
|
247
254
|
|
248
255
|
def pulp_update_needed?
|
249
256
|
changeable_attributes = %w(url unprotected checksum_type docker_upstream_name download_policy mirror_on_sync verify_ssl_on_sync
|
250
|
-
upstream_username upstream_password ostree_upstream_sync_policy ostree_upstream_sync_depth ignore_global_proxy ignorable_content
|
257
|
+
upstream_username upstream_password ostree_upstream_sync_policy ostree_upstream_sync_depth ignore_global_proxy ignorable_content
|
258
|
+
ssl_ca_cert_id ssl_client_cert_id ssl_client_key_id)
|
251
259
|
changeable_attributes += %w(name container_repository_name docker_tags_whitelist) if docker?
|
252
260
|
changeable_attributes += %w(deb_releases deb_components deb_architectures gpg_key_id) if deb?
|
253
261
|
changeable_attributes.any? { |key| previous_changes.key?(key) }
|
@@ -12,8 +12,6 @@ module Katello
|
|
12
12
|
WEEKLY = 'weekly'.freeze
|
13
13
|
CUSTOM_CRON = 'custom cron'.freeze
|
14
14
|
TYPES = [HOURLY, DAILY, WEEKLY, CUSTOM_CRON].freeze
|
15
|
-
DURATION = {HOURLY => 'T1H', DAILY => 'T24H', WEEKLY => '7D' }.freeze
|
16
|
-
WEEK_DAYS = %w(Sunday Monday Tuesday Wednesday Thursday Friday).collect { |d| N_(d) }
|
17
15
|
|
18
16
|
belongs_to :organization, :inverse_of => :sync_plans
|
19
17
|
has_many :products, :class_name => "Katello::Product", :dependent => :nullify
|
@@ -93,39 +91,11 @@ module Katello
|
|
93
91
|
errors.add :base, _("Start Date and Time can't be blank") if self.sync_date.nil?
|
94
92
|
end
|
95
93
|
|
96
|
-
def
|
97
|
-
WEEK_DAYS[self.sync_date.strftime('%A').to_i]
|
98
|
-
end
|
99
|
-
|
100
|
-
def plan_date
|
101
|
-
self.sync_date.strftime('%m/%d/%Y')
|
102
|
-
end
|
103
|
-
|
104
|
-
def plan_time
|
105
|
-
self.sync_date.strftime('%I:%M %p')
|
106
|
-
end
|
107
|
-
|
108
|
-
def plan_date_time
|
109
|
-
self.sync_date.strftime('%Y/%m/%d %H:%M:%S %z')
|
110
|
-
end
|
111
|
-
|
112
|
-
def plan_zone
|
113
|
-
self.sync_date.strftime('%Z')
|
114
|
-
end
|
115
|
-
|
116
|
-
def sync_time
|
117
|
-
self.sync_date.utc.strftime('%H%M%S%N')
|
118
|
-
end
|
119
|
-
|
120
|
-
def next_sync_date
|
94
|
+
def next_sync
|
121
95
|
return nil unless self.enabled
|
122
96
|
self.foreman_tasks_recurring_logic&.tasks&.order(:start_at)&.last&.start_at
|
123
97
|
end
|
124
98
|
|
125
|
-
def next_sync
|
126
|
-
next_sync_date.try(:strftime, '%Y/%m/%d %H:%M:%S %z')
|
127
|
-
end
|
128
|
-
|
129
99
|
def self.humanize_class_name(_name = nil)
|
130
100
|
_("Sync Plans")
|
131
101
|
end
|
@@ -34,9 +34,9 @@ module Katello
|
|
34
34
|
options = {
|
35
35
|
protected: true,
|
36
36
|
id: yum_dist_id,
|
37
|
-
auto_publish: true
|
38
|
-
checksum_type: repo.saved_checksum_type || root.checksum_type
|
37
|
+
auto_publish: true
|
39
38
|
}
|
39
|
+
options[:checksum_type] = repo.saved_checksum_type || root.checksum_type if smart_proxy.pulp_master?
|
40
40
|
distributors = [Runcible::Models::YumDistributor.new(repo.relative_path, root.unprotected, true, options)]
|
41
41
|
|
42
42
|
if smart_proxy.pulp_master?
|
@@ -13,7 +13,7 @@ glue(@object.root) do
|
|
13
13
|
attributes :id, :cp_id, :name
|
14
14
|
attributes :orphaned? => :orphaned
|
15
15
|
attributes :redhat? => :redhat
|
16
|
-
|
16
|
+
child :sync_plan do |_sync_plan|
|
17
17
|
attributes :name, :description, :sync_date, :interval, :next_sync
|
18
18
|
end
|
19
19
|
end
|
@@ -1,2 +1,2 @@
|
|
1
1
|
collection @manifest_history
|
2
|
-
attributes :statusMessage, :status, :created
|
2
|
+
attributes :id, :statusMessage, :status, :created
|