Skip to content

Commit

Permalink
Fixes #6460,BZ1115553 - Removing old orchestration hook
Browse files Browse the repository at this point in the history
  • Loading branch information
David Davis committed Jul 2, 2014
1 parent 160eddf commit c094d90
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 38 deletions.
2 changes: 1 addition & 1 deletion app/lib/actions/katello/repository/destroy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ def plan(repository)
action_subject(repository)
plan_action(Pulp::Repository::Destroy, pulp_id: repository.pulp_id)
plan_action(Product::ContentDestroy, repository)
plan_action(ContentView::UpdateEnvironment, repository.content_view, repository.environment)
plan_action(ElasticSearch::Repository::Destroy, pulp_id: repository.pulp_id)
repository.destroy!
end

def humanized_name
_("Delete")
end

end
end
end
Expand Down
5 changes: 0 additions & 5 deletions app/models/katello/glue/candlepin/content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def self.included(base)

base.class_eval do
before_save :save_content_orchestration
after_destroy :update_environment_content
after_create :rectify_gpg_key_orchestration
end
end
Expand All @@ -36,10 +35,6 @@ def save_content_orchestration
end
end

def update_environment_content
self.content_view.update_cp_content(self.environment)
end

def rectify_gpg_key_orchestration
#if we are creating a repo with a gpg key, we have to create the content without the gpg key
# and then update the content with the gpg key (since repo needs content created before it is actually saved
Expand Down
32 changes: 0 additions & 32 deletions spec/models/environment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,38 +187,6 @@ module Katello
@organization.library.must_be :valid?
end
end

describe "updating CP content assignment" do
it "should add content not already promoted" do
@content_view_environment = @environment.content_views.first.
content_view_environments.where(:environment_id=>@environment.id).first
already_promoted_content("123", "456")
newly_promoted_content("123", "456", "789", "10")
Resources::Candlepin::Environment.expects(:add_content).with(@content_view_environment.cp_id,
Set.new(["789", "10"]))
@content_view_environment.update_cp_content
end

def already_promoted_content(*content_ids)
@already_promoted_content_ids = content_ids
Resources::Candlepin::Environment.stubs(:find).returns(
{:environmentContent => @already_promoted_content_ids.map {|id| {:contentId => id}}})
end

def newly_promoted_content(*content_ids)
promoted_repos = content_ids.map do |id|
repo = stub
repo.stubs(:content_id).returns(id)
repo.stubs(:yum?).returns(true)
repo
end

content_view = stub
content_view.stubs(:repos).returns(promoted_repos)
@content_view_environment.stubs(:content_view).returns(content_view)
end
end

end
end
end

0 comments on commit c094d90

Please sign in to comment.