diff --git a/app/lib/actions/katello/content_view/publish.rb b/app/lib/actions/katello/content_view/publish.rb index cf3969dc74f..c3c3383449c 100644 --- a/app/lib/actions/katello/content_view/publish.rb +++ b/app/lib/actions/katello/content_view/publish.rb @@ -6,6 +6,7 @@ class Publish < Actions::EntryAction include ::Katello::ContentViewHelper include ::Actions::ObservableAction attr_accessor :version + execution_plan_hooks.use :trigger_capsule_sync, :on => :success execution_plan_hooks.use :notify_on_failure, :on => [:failure, :paused] diff --git a/app/lib/actions/katello/content_view_version/create_repos.rb b/app/lib/actions/katello/content_view_version/create_repos.rb index 40c667c6d2c..f543a7ce747 100644 --- a/app/lib/actions/katello/content_view_version/create_repos.rb +++ b/app/lib/actions/katello/content_view_version/create_repos.rb @@ -4,6 +4,7 @@ module ContentViewVersion class CreateRepos < Actions::Base # allows accessing the build object from the superior action attr_accessor :repository_mapping + def plan(version, source_repositories = []) self.repository_mapping = {} concurrence do diff --git a/app/lib/katello/errors.rb b/app/lib/katello/errors.rb index 6524ca8c000..90fa7649060 100644 --- a/app/lib/katello/errors.rb +++ b/app/lib/katello/errors.rb @@ -134,6 +134,7 @@ def self.from_task(task) end class UpstreamCandlepinError < CandlepinError; end + class UpstreamConsumerGone < StandardError def message _("The manifest doesn't exist on console.redhat.com. " \ diff --git a/app/lib/katello/http_resource.rb b/app/lib/katello/http_resource.rb index 08c5783bed0..82551f48be2 100644 --- a/app/lib/katello/http_resource.rb +++ b/app/lib/katello/http_resource.rb @@ -8,6 +8,7 @@ class NetworkException < StandardError class RestClientException < StandardError attr_reader :service_code, :code + def initialize(params) super params[:message] @service_code = params[:service_code] diff --git a/app/lib/katello/util/cdn_var_substitutor.rb b/app/lib/katello/util/cdn_var_substitutor.rb index 1ce97a27711..26d1974453e 100644 --- a/app/lib/katello/util/cdn_var_substitutor.rb +++ b/app/lib/katello/util/cdn_var_substitutor.rb @@ -3,6 +3,7 @@ module Util class CdnVarSubstitutor attr_reader :good_listings attr_reader :bad_listings + # cdn_resource - an object providing access to CDN. It has to # provide a get method that takes a path (e.g. # /content/rhel/6.2/listing) and returns the body response) diff --git a/app/services/katello/pulp3/content_view_version/export.rb b/app/services/katello/pulp3/content_view_version/export.rb index 7fff6c1406c..d92b767d56e 100644 --- a/app/services/katello/pulp3/content_view_version/export.rb +++ b/app/services/katello/pulp3/content_view_version/export.rb @@ -8,6 +8,7 @@ class Export FORMATS = [SYNCABLE, IMPORTABLE].freeze attr_reader :smart_proxy, :content_view_version, :destination_server, :from_content_view_version, :repository, :base_path + def self.create(options) if options.delete(:format) == SYNCABLE SyncableFormatExport.new(**options) diff --git a/app/services/katello/pulp3/repository.rb b/app/services/katello/pulp3/repository.rb index 0ab21b12c9b..2aafdb297d9 100644 --- a/app/services/katello/pulp3/repository.rb +++ b/app/services/katello/pulp3/repository.rb @@ -7,6 +7,7 @@ class Repository include Katello::Pulp3::ServiceCommon attr_accessor :repo attr_accessor :smart_proxy + delegate :root, to: :repo delegate :pulp3_api, to: :smart_proxy diff --git a/app/services/katello/pulp3/repository_mirror.rb b/app/services/katello/pulp3/repository_mirror.rb index e7e2f300091..7d002792954 100644 --- a/app/services/katello/pulp3/repository_mirror.rb +++ b/app/services/katello/pulp3/repository_mirror.rb @@ -2,6 +2,7 @@ module Katello module Pulp3 class RepositoryMirror attr_accessor :repo_service + delegate :repo, to: :repo_service delegate :smart_proxy, to: :repo_service diff --git a/app/services/katello/pulp3/task.rb b/app/services/katello/pulp3/task.rb index 296fcbef6d9..fa13fc2d247 100644 --- a/app/services/katello/pulp3/task.rb +++ b/app/services/katello/pulp3/task.rb @@ -39,6 +39,7 @@ class Task #needed for serialization in dynflow attr_reader :pulp_data + delegate :[], :key?, :dig, :to_hash, :to => :task_data def initialize(smart_proxy, data) diff --git a/app/services/katello/smart_proxy_helper.rb b/app/services/katello/smart_proxy_helper.rb index 762d85bc06c..14edb3d4e98 100644 --- a/app/services/katello/smart_proxy_helper.rb +++ b/app/services/katello/smart_proxy_helper.rb @@ -1,6 +1,7 @@ module Katello class SmartProxyHelper attr_accessor :smart_proxy + def initialize(smart_proxy) @smart_proxy = smart_proxy end diff --git a/db/migrate/20160114200145_add_mirror_on_sync_to_repositories.rb b/db/migrate/20160114200145_add_mirror_on_sync_to_repositories.rb index 0bcd346926a..30e7dda5a3f 100644 --- a/db/migrate/20160114200145_add_mirror_on_sync_to_repositories.rb +++ b/db/migrate/20160114200145_add_mirror_on_sync_to_repositories.rb @@ -2,6 +2,7 @@ class AddMirrorOnSyncToRepositories < ActiveRecord::Migration[4.2] class RepositoryMirrorOnSync < ApplicationRecord self.table_name = "katello_repositories" end + def change add_column :katello_repositories, :mirror_on_sync, :boolean, :default => true, :null => false RepositoryMirrorOnSync.update_all(:mirror_on_sync => false) diff --git a/db/migrate/20160131182301_add_download_policy_to_katello_repositories.rb b/db/migrate/20160131182301_add_download_policy_to_katello_repositories.rb index 33fc383accc..30a0a3361e9 100644 --- a/db/migrate/20160131182301_add_download_policy_to_katello_repositories.rb +++ b/db/migrate/20160131182301_add_download_policy_to_katello_repositories.rb @@ -2,6 +2,7 @@ class AddDownloadPolicyToKatelloRepositories < ActiveRecord::Migration[4.2] class DownloadPolicyRepository < ApplicationRecord self.table_name = "katello_repositories" end + def change add_column :katello_repositories, :download_policy, :string, :limit => 255 DownloadPolicyRepository.where(content_type: 'yum').update_all(download_policy: 'immediate') diff --git a/db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb b/db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb index 16d9a12c25d..d1b0fe22215 100644 --- a/db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb +++ b/db/migrate/20210119162528_delete_puppet_and_ostree_repos.rb @@ -14,12 +14,15 @@ class FakeRepositoryPuppetModule < Katello::Model class FakeContentViewPuppetEnvironment < Katello::Model self.table_name = 'katello_content_view_puppet_environments' end + class FakePuppetModule < Katello::Model self.table_name = 'katello_puppet_modules' end + class FakeRepositoryOstreeBranch < Katello::Model self.table_name = 'katello_repository_ostree_branches' end + class FakeOstreeBranch < Katello::Model self.table_name = 'katello_ostree_branches' end diff --git a/lib/monkeys/ar_postgres_evr_t.rb b/lib/monkeys/ar_postgres_evr_t.rb index b349d527217..d8c0e421d84 100644 --- a/lib/monkeys/ar_postgres_evr_t.rb +++ b/lib/monkeys/ar_postgres_evr_t.rb @@ -9,6 +9,7 @@ def get_oid_type(oid, fmod, column_name, sql_type = "".freeze) super end end + module ActiveRecord module ConnectionAdapters module PostgreSQL @@ -16,6 +17,7 @@ module OID # :nodoc: class EvrT < Type::String; end # :nodoc: end end + class PostgreSQLAdapter < AbstractAdapter prepend PostgreSQLAdapterExtensions end diff --git a/test/mailers/subscription_mailer_test.rb b/test/mailers/subscription_mailer_test.rb index c7fc20bda9d..f99dce44b1a 100644 --- a/test/mailers/subscription_mailer_test.rb +++ b/test/mailers/subscription_mailer_test.rb @@ -21,6 +21,7 @@ class TestBase < ActiveSupport::TestCase subscription_id: ActiveRecord::FixtureSet.identify(:other_subscription)) # Setting[:expire_soon_days] || 120 end end + class SubscriptionMailerTest < TestBase def setup @user = User.find(users('admin').id) diff --git a/test/support/annotations/annotation_file.rb b/test/support/annotations/annotation_file.rb index 80af87c6c40..3f69735737a 100644 --- a/test/support/annotations/annotation_file.rb +++ b/test/support/annotations/annotation_file.rb @@ -2,6 +2,7 @@ module Katello module Annotations class AnnotationFile attr_accessor :name, :annotations, :cassette_name + def initialize(hash) self.name = hash['name'] self.annotations = hash['annotations'].map { |annotation| MatchedAnnotation.new(annotation) }