[Refs #221] Add xml-rpc call for iso container destroy

This commit is contained in:
Vladimir Sharshov 2012-02-29 15:15:49 +04:00
parent 062b5c71b1
commit 02cbec8d86
2 changed files with 16 additions and 2 deletions

View File

@ -14,6 +14,7 @@ class ProductBuildList < ActiveRecord::Base
attr_accessor :base_url
after_create :xml_rpc_create
after_destroy :xml_delete_iso_container
def container_path
"/downloads/#{product.platform.name}/product/#{id}/"
@ -34,8 +35,17 @@ class ProductBuildList < ActiveRecord::Base
if result == ProductBuilder::SUCCESS
return true
else
# return false
raise "Failed to create product_build_list #{id} inside platform #{product.platform.name} tar url #{tar_url} with code #{result}."
raise "Failed to create product_build_list #{id} inside platform #{platform.name} tar url #{tar_url} with code #{result}."
end
end
def xml_delete_iso_container
result = ProductBuilder.delete_iso_container platform.name, id
if result == ProductBuilder::SUCCESS
return true
else
raise "Failed to destroy product_build_list #{id} inside platform #{platform.name} with code #{result}."
end
end
end

View File

@ -14,4 +14,8 @@ class ProductBuilder
call('create_product', pbl.id.to_s, pbl.product.platform.name, pbl.product.ks, pbl.product.menu, pbl.product.build_script,
pbl.product.counter, [], pbl.product.tar.exists? ? "#{pbl.base_url}#{pbl.product.tar.url}" : '')
end
def self.delete_iso_container(plname, id):
self.client(pbl.product.platform.distrib_type).call('delete_iso_container', plname, id)
end
end