Revision 40e52c7b
Added by Ivan Necas about 10 years ago
app/models/katello/glue/pulp/repo.rb | ||
---|---|---|
base.class_eval do
|
||
|
||
before_save :save_repo_orchestration
|
||
before_destroy :destroy_repo_orchestration
|
||
|
||
lazy_accessor :pulp_repo_facts,
|
||
:initializer => (lambda do |s|
|
||
... | ... | |
module InstanceMethods
|
||
def save_repo_orchestration
|
||
case orchestration_for
|
||
when :create
|
||
#pre_queue.create(:name => "create pulp repo: #{self.name}", :priority => 2, :action => [self, :create_pulp_repo])
|
||
when :update
|
||
if self.pulp_update_needed?
|
||
pre_queue.create(:name => "update pulp repo: #{self.name}", :priority => 2,
|
||
... | ... | |
PulpTaskStatus.using_pulp_task(task)
|
||
end
|
||
|
||
def destroy_repo
|
||
Katello.pulp_server.extensions.repository.delete(self.pulp_id)
|
||
true
|
||
end
|
||
|
||
def other_repos_with_same_product_and_content
|
||
Repository.where(:content_id => self.content_id).in_product(self.product).pluck(:pulp_id) - [self.pulp_id]
|
||
end
|
||
... | ... | |
Repository.where(:content_id => self.content_id).pluck(:pulp_id) - [self.pulp_id]
|
||
end
|
||
|
||
def destroy_repo_orchestration
|
||
pre_queue.create(:name => "delete pulp repo : #{self.name}", :priority => 3, :action => [self, :destroy_repo])
|
||
end
|
||
|
||
def package_ids
|
||
Katello.pulp_server.extensions.repository.rpm_ids(self.pulp_id)
|
||
end
|
Also available in: Unified diff
Finish repo deletion orchestration