From: Jan Provaznik <jprovazn(a)redhat.com>
---
src/app/controllers/deployables_controller.rb | 18 ---------------
src/app/models/deployable.rb | 30 -------------------------
src/app/views/deployables/show.html.haml | 4 ---
src/config/routes.rb | 2 -
4 files changed, 0 insertions(+), 54 deletions(-)
diff --git a/src/app/controllers/deployables_controller.rb
b/src/app/controllers/deployables_controller.rb
index 8dbc7cb..8f724c3 100644
--- a/src/app/controllers/deployables_controller.rb
+++ b/src/app/controllers/deployables_controller.rb
@@ -230,24 +230,6 @@ class DeployablesController < ApplicationController
redirect_to_original({"catalog_entries_preset_filter" =>
params[:catalog_entries_preset_filter], "catalog_entries_search" =>
params[:catalog_entries_search]})
end
- def build
- catalog = Catalog.find(params[:catalog_id]) if params[:catalog_id].present?
- deployable = Deployable.find(params[:id])
- require_privilege(Privilege::MODIFY, catalog) if catalog.present?
- require_privilege(Privilege::MODIFY, deployable)
-
- images = deployable.fetch_images
- accounts = ProviderAccount.list_for_user(current_user, Privilege::VIEW)
- options = params[:build_options].to_sym
- case options
- when :build_missing
- deployable.build_missing(images, accounts)
- when :push_missing
- deployable.push_missing(images, accounts)
- end
- redirect_to polymorphic_path([catalog, deployable])
- end
-
private
def set_header
diff --git a/src/app/models/deployable.rb b/src/app/models/deployable.rb
index 91a196d..538b6f6 100644
--- a/src/app/models/deployable.rb
+++ b/src/app/models/deployable.rb
@@ -171,36 +171,6 @@ class Deployable < ActiveRecord::Base
:pushed
end
- def build_missing(images, accounts)
- targets = accounts.map { |acc| acc.provider.provider_type.deltacloud_driver
}.uniq.join(',')
- images.each do |image|
- factory_image = Aeolus::Image::Factory::Image.new(:id => image.id)
- factory_image.targets = targets
- factory_image.template = image.template
- factory_image.save!
- end
- end
-
- def push_missing(images, accounts)
- images.each do |image|
- accounts.each do |account|
- if image_status(image, account) == :not_pushed
- target = account.provider.provider_type.deltacloud_driver
- build = image.latest_pushed_or_unpushed_build
- target_image = build.target_images.find { |ti| ti.target == target }
- provider_image = Aeolus::Image::Factory::ProviderImage.new(
- :provider => account.provider.name,
- :credentials => account.to_xml(:with_credentials => true),
- :image_id => image.uuid,
- :build_id => build.uuid,
- :target_image_id => target_image.uuid
- )
- provider_image.save!
- end
- end
- end
- end
-
def to_polymorphic_path_param(polymorphic_path_extras)
catalog = catalogs.find(polymorphic_path_extras[:catalog_id]) if
(polymorphic_path_extras.present? &&
polymorphic_path_extras.has_key?(:catalog_id))
diff --git a/src/app/views/deployables/show.html.haml
b/src/app/views/deployables/show.html.haml
index 8519ee0..2c88513 100644
--- a/src/app/views/deployables/show.html.haml
+++ b/src/app/views/deployables/show.html.haml
@@ -45,10 +45,6 @@
- if @missing_images.empty?
%header
%h2.build= t('.build')
- .section-controls
- = form_tag(polymorphic_path([@catalog, @deployable], :action =>
'build')) do
- = select_tag :build_options,
options_for_select([[t(".build_missing"), :build_missing],
[t(".push_missing"), :push_missing]])
- = submit_tag t('.start'), :id => :start_build, :class =>
'button pill'
.content
%p.description.align-center= t('.build_description')
diff --git a/src/config/routes.rb b/src/config/routes.rb
index 8a43907..9a270a8 100644
--- a/src/config/routes.rb
+++ b/src/config/routes.rb
@@ -207,7 +207,6 @@ Conductor::Application.routes.draw do
post :filter
end
member do
- post :build
get :definition
end
end
@@ -221,7 +220,6 @@ Conductor::Application.routes.draw do
post :filter
end
member do
- post :build
get :definition
end
end
--
1.7.7.5