[PATCH conductor] Fixed deployment launch architecture selection
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
Hardware profile selection list is now filtered according to an assembly
architecture per each assembly.
---
.../resources/deployments_controller.rb | 8 +-------
src/app/views/resources/deployments/new.haml | 6 ++++--
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/app/controllers/resources/deployments_controller.rb b/src/app/controllers/resources/deployments_controller.rb
index 81378f8..96f17ae 100644
--- a/src/app/controllers/resources/deployments_controller.rb
+++ b/src/app/controllers/resources/deployments_controller.rb
@@ -115,15 +115,9 @@ class Resources::DeploymentsController < ApplicationController
def init_new_deployment_attrs
@pools = Pool.list_for_user(@current_user, Privilege::CREATE, :target_type => Deployment)
@realms = FrontendRealm.all
- # FIXME: temporary for debugging
- #arch = @deployment.deployable.assemblies.first.templates.first.architecture
- arch = 'x86_64'
@hardware_profiles = HardwareProfile.all(
:include => :architecture,
- :conditions => {
- :provider_id => nil,
- 'hardware_profile_properties.value' => arch
- }
+ :conditions => {:provider_id => nil}
)
end
end
diff --git a/src/app/views/resources/deployments/new.haml b/src/app/views/resources/deployments/new.haml
index 6e5a1ff..42e75fe 100644
--- a/src/app/views/resources/deployments/new.haml
+++ b/src/app/views/resources/deployments/new.haml
@@ -16,8 +16,10 @@
%h3 Assemblies hardware profiles
%ul
- @deployment.deployable.assemblies.each do |assembly|
- = label_tag "hw_profiles[#{assembly.id}]", assembly.name
- = select_tag "hw_profiles[#{assembly.id}]", options_from_collection_for_select(@hardware_profiles, 'id', 'name')
+ %li
+ - hwprofiles = @hardware_profiles.select {|hwp| hwp.architecture.value == assembly.templates.first.architecture}
+ = label_tag "hw_profiles[#{assembly.id}]", assembly.name
+ = select_tag "hw_profiles[#{assembly.id}]", options_from_collection_for_select(hwprofiles, 'id', 'name')
= submit_tag 'Cancel', :name => 'cancel'
= submit_tag 'Launch', :name => 'launch'
--
1.7.4
12 years, 11 months
launching instances w/o realms
by wes hayutin
Question for the group...
I have built a template for both us-east and us-west and pushed the
template. I have *NOT* created any realms. When I launch the template is
the correct behavior to launch in us-east or in both us-east and
us-west?
Thank you!
12 years, 11 months
RM #1348 ViewState model
by Tomas Sedovic
This is the first stab at the Redmine task 1348:
Create a ViewState model that can store an arbitrary number of key-value pairs.
It works, but only for keys and values that are strings.
Do we want it to handle storing arbitrary objects as well?
Thomas
12 years, 11 months
[PATCH] dc:prepare_repos another try to fix random download failures
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
This patch adds retries when an error occurs.
---
.../util/repository_manager/comps_repository.rb | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/app/util/repository_manager/comps_repository.rb b/src/app/util/repository_manager/comps_repository.rb
index 3e57589..a13f461 100644
--- a/src/app/util/repository_manager/comps_repository.rb
+++ b/src/app/util/repository_manager/comps_repository.rb
@@ -107,14 +107,21 @@ class CompsRepository < AbstractRepository
end
def download_xml(url)
- resp = Typhoeus::Request.get(url, :timeout => 30000, :follow_location => true, :max_redirects => 3)
- unless resp.code == 200
- raise "failed to fetch #{url}: #{resp.body}"
+ body = nil
+ 5.times do |i|
+ resp = Typhoeus::Request.get(url, :timeout => 60000, :follow_location => true, :max_redirects => 10)
+ if resp.code == 200
+ body = resp.body
+ break
+ end
+ sleep 2
end
+ raise "failed to fetch #{url}, aborting" unless body
+
if url =~ /\.gz$/
- return Zlib::GzipReader.new(StringIO.new(resp.body)).read
+ return Zlib::GzipReader.new(StringIO.new(body)).read
else
- return resp.body
+ return body
end
end
--
1.7.4.4
12 years, 11 months