[PATCH aeolus-conductor] BZ#790250 Check Build Status on Show Image
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
src/app/views/images/show.html.haml | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/app/views/images/show.html.haml b/src/app/views/images/show.html.haml
index 7681cee..1d31d36 100644
--- a/src/app/views/images/show.html.haml
+++ b/src/app/views/images/show.html.haml
@@ -57,6 +57,8 @@
%h3= group[:type].name
- if @build and b = @builder.find_active_build((a)build.id, driver)
= label_tag b.status
+ - elsif !@build and b = @builder.find_active_build_by_imageid((a)image.id, driver)
+ = label_tag b.status
- elsif timg
= button_to t('.delete'), image_target_image_path((a)image.id, timg.id), :method => :delete
- elsif @build and @build.id == @latest_build
--
1.7.6.4
12 years, 2 months
BZ#790250 Check Build Status on Show Image
by Martyn Taylor
This is a quick fix for the BZ.
There are no cucumber tests included, since there are no steps already defined for images at all, other than upload XML and template.
Implementing the full list of steps to get to the point where we can test this small change is not practical in this commit + we have a deadline coming up.
There are a lot of issues in the Images Controller and View as well as in aeolus-image builders model. These are out of the scope of this patch. Next iteration I propose we do some serious tidying up these areas.
That aside.
To test this patch.
You need to kick off a build that takes some time. (I've tested with RHEVM). Then go to the show page of the image you have just created. There should be no build button, in its place should be the state of the active build.
Regards
Martyn
12 years, 2 months
[PATCH conductor] fix conductor spec suite on ruby 1.9
by Mo Morsi
spec suite now fully runs successfully
---
src/app/controllers/application_controller.rb | 2 +-
src/app/controllers/deployables_controller.rb | 2 +-
.../controllers/permissions_controller_spec.rb | 2 +-
src/spec/controllers/pools_controller_spec.rb | 5 ++++-
4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb
index be2ded3..aa80e44 100644
--- a/src/app/controllers/application_controller.rb
+++ b/src/app/controllers/application_controller.rb
@@ -112,7 +112,7 @@ class ApplicationController < ActionController::Base
end
# Returns an array of ids from params[:id], params[:ids].
- def ids_list(other_attrs=[])
+ def ids_list(*other_attrs)
other_attrs.each do |attr_key|
return params[attr_key].to_a if params.include?(attr_key)
end
diff --git a/src/app/controllers/deployables_controller.rb b/src/app/controllers/deployables_controller.rb
index e37bc4a..cd66133 100644
--- a/src/app/controllers/deployables_controller.rb
+++ b/src/app/controllers/deployables_controller.rb
@@ -116,7 +116,7 @@ class DeployablesController < ApplicationController
require_privilege(Privilege::CREATE, Deployable)
@deployable = Deployable.new(params[:deployable])
- @selected_catalogs = Catalog.find(params[:catalog_id].to_a)
+ @selected_catalogs = Catalog.find(Array(params[:catalog_id]))
@deployable.owner = current_user
if params.has_key? :url
diff --git a/src/spec/controllers/permissions_controller_spec.rb b/src/spec/controllers/permissions_controller_spec.rb
index 8c4741b..7cedb29 100644
--- a/src/spec/controllers/permissions_controller_spec.rb
+++ b/src/spec/controllers/permissions_controller_spec.rb
@@ -35,7 +35,7 @@ describe PermissionsController do
@permission = FactoryGirl.create(:permission, :user => @admin, :role => @old_role, :permission_object => @deployable)
post :multi_update, :permission_object_id => @deployable.id, :permission_object_type => @deployable.class.to_s,
- :permission_role_selected => "#{@permission.id},#{(a)new_role.id}", :polymorphic_path_extras => { 'catalog_id' => @catalog.id}
+ :permission_role_selected => ["#{@permission.id},#{(a)new_role.id}"], :polymorphic_path_extras => { 'catalog_id' => @catalog.id}
response.should redirect_to catalog_deployable_path(@catalog, @deployable)
end
diff --git a/src/spec/controllers/pools_controller_spec.rb b/src/spec/controllers/pools_controller_spec.rb
index 21af9d0..ba68755 100644
--- a/src/spec/controllers/pools_controller_spec.rb
+++ b/src/spec/controllers/pools_controller_spec.rb
@@ -119,7 +119,10 @@ describe PoolsController do
describe "#destroy" do
before do
@pool = Factory.build(:pool)
- Pool.stub!(:find).and_return([@pool])
+ @tpool = Factory.build(:tpool)
+ @pool.save!
+ @tpool.save!
+ Pool.stub!(:find).and_return([@pool], @tpool)
delete :multi_destroy, :pools_selected => [@pool.id], :format => :json
end
--
1.7.6.5
12 years, 2 months
[PATCH multi 0/3] #795743 - Architecture on imported images (v2)
by Matt Wagner
This is a resend of my earlier patch, "BZ 795743 - Detect architecture for imported images" in response to Jan's feedback. Namely, he pointed out that, since we're storing this architecture attribute for imported images, we might as well *display* it. I added that in this patch.
I got sick of writing "image.os.arch || image.architecture", so I added an "architecture" method to images in aeolus-image-rubygem to do that for us. This patch is already introducing changes to aeolus-image-rubygem so this seemed tolerable, though this change does mean that you'll get exceptions if you upgrade Conductor and not aeolus-image-rubygem. (So I'll send out an [ANNOUNCE] message noting this after this patch is ACKed but before pushing, as someone proposed earlier today.)
-- Matt
12 years, 2 months
[PATCH 0/1] rev 2
by Jason Guiditta
Fixes a view that I missed, and resets the cuke tests - apparently they
were not failing becuase cucumber wasn't rendering t() strings as I thought,
they were reporting a legitimate error! Who'd a thunk it...
12 years, 2 months
conductor html improvements
by Andrew Fitzsimon
Hi All,
I'll save it for tomorrow to do a proper writeup and finish the mockup
but i've added some of the things i've been working on
(with lots of help from Tomas) here.
https://github.com/andyfitz/mockductor/tree/master/static
I'll merge it into the conductor UI repo soon too
Basically this gives more power to the stylesheet and simplifies the html view structure and linking workflows hugely.
a very immature state of an example app is here. no it won't work in old browsers but now supporting them will be much much easier.
http://file.bne.redhat.com/~afitzsim/static/login.html
(sorry about the internal link)
Four things to think of about
* any view can be activated or have any content from it inlined simply with a link.
* no stylistic classes to worry about remembering, functional classes only (e.g. .active not .tab or .left-120)
* no bitmaps or images to maintain, slice or cringe at when scaled
* Eventually three http requests only (css,js,html) (which we could even inline to one)
* freakin tiny
* more control to css, less maintaining html.
initial thoughts ?
12 years, 2 months
[PATCH configure] BZ 795935 - Remove passwords from /etc/imagefactory/.json files
by Richard Su
https://bugzilla.redhat.com/show_bug.cgi?id=795935
Removed passwords for vsphere and rhevm. Removed vsphere username
and password from aeolus-configure because they are not used
elsewhere.
---
conf/vsphere_configure | 2 --
.../aeolus/manifests/profiles/vsphere/instance.pp | 2 --
recipes/aeolus/templates/rhevm.json | 1 -
recipes/aeolus/templates/vsphere.json | 2 --
4 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/conf/vsphere_configure b/conf/vsphere_configure
index ca5bffe..b724a4e 100644
--- a/conf/vsphere_configure
+++ b/conf/vsphere_configure
@@ -14,7 +14,5 @@ classes:
# Uncomment and provide values to match your vSphere environment.
# Values below are examples.
# deltacloud_provider: vsphere.server.com
- # username: username
- # password: password
# datastore: datastore
# network_name: network_name
diff --git a/recipes/aeolus/manifests/profiles/vsphere/instance.pp b/recipes/aeolus/manifests/profiles/vsphere/instance.pp
index 55ac95f..1210fd4 100644
--- a/recipes/aeolus/manifests/profiles/vsphere/instance.pp
+++ b/recipes/aeolus/manifests/profiles/vsphere/instance.pp
@@ -13,8 +13,6 @@
# limitations under the License.
define aeolus::profiles::vsphere::instance ($deltacloud_provider,
- $username,
- $password,
$datastore,
$network_name)
{
diff --git a/recipes/aeolus/templates/rhevm.json b/recipes/aeolus/templates/rhevm.json
index fe7bbb6..21eae81 100644
--- a/recipes/aeolus/templates/rhevm.json
+++ b/recipes/aeolus/templates/rhevm.json
@@ -10,7 +10,6 @@
"nfs-path": "<%= params['nfs_export'] %>",
"nfs-host": "<%= params['nfs_server'] %>",
"api-url": "<%= params['deltacloud_api'] %>",
- "password": "<%= params['deltacloud_password'] %>",
"cluster": "_any_",
"timeout": <%= params['push_timeout'] %>
}<%= remaining_instances.zero? ? nil : ',' %>
diff --git a/recipes/aeolus/templates/vsphere.json b/recipes/aeolus/templates/vsphere.json
index af8fecc..4109978 100644
--- a/recipes/aeolus/templates/vsphere.json
+++ b/recipes/aeolus/templates/vsphere.json
@@ -6,8 +6,6 @@
"vsphere-<%= name %>":
{
"api-url": "https://<%= params['deltacloud_provider'] %>/sdk",
- "username": "<%= params['username'] %>",
- "password": "<%= params['password'] %>",
"datastore": "<%= params['datastore'] %>",
"network_name": "<%= params['network_name'] %>"
}<%= remaining_instances.zero? ? nil : ',' %>
--
1.7.7.6
12 years, 2 months
[PATCH conductor] BZ 790860 - improved availability checking
by Jan Provazník
From: Jan Provazník <jan.provaznik(a)gmail.com>
'available' flag is now set also on 'test connect' and successful 'update' action
this patch also fixes bug with missing provider_types if new/edit form is
rendered from update/create actions
---
src/app/controllers/providers_controller.rb | 5 +++--
src/app/models/provider.rb | 21 ++++++++++-----------
src/spec/controllers/provider_controller_spec.rb | 15 +++++++++++++++
3 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/src/app/controllers/providers_controller.rb b/src/app/controllers/providers_controller.rb
index 0819b99..9de75dd 100644
--- a/src/app/controllers/providers_controller.rb
+++ b/src/app/controllers/providers_controller.rb
@@ -17,7 +17,7 @@
class ProvidersController < ApplicationController
before_filter :require_user
before_filter :load_providers, :only => [:index, :show, :new, :edit, :create, :update]
- before_filter :load_providers_types, :only => [:new, :edit]
+ before_filter :load_providers_types, :only => [:new, :edit, :update, :create]
def index
@params = params
@@ -129,6 +129,7 @@ class ProvidersController < ApplicationController
end
if @provider.save
+ @provider.update_availability
flash[:notice] = t"providers.flash.notice.updated"
redirect_to edit_provider_path(@provider)
else
@@ -166,7 +167,7 @@ class ProvidersController < ApplicationController
def test_connection(provider)
@provider.errors.clear
- if @provider.connect
+ if @provider.update_availability
flash.now[:notice] = t"providers.flash.notice.connected"
else
flash.now[:warning] = t"providers.flash.warning.connect_failed"
diff --git a/src/app/models/provider.rb b/src/app/models/provider.rb
index 9d5877c..2033a04 100644
--- a/src/app/models/provider.rb
+++ b/src/app/models/provider.rb
@@ -140,22 +140,21 @@ class Provider < ActiveRecord::Base
provider_accounts.inject([]) {|all, pa| all += pa.instances.stoppable_inaccessible}
end
+ def update_availability
+ self.available = valid_framework?
+ if self.available_changed? and !new_record?
+ update_attribute(:available, self.available)
+ logger.warn "#{name} provider's availability changed to #{self.available}"
+ end
+ self.available
+ end
+
def populate_realms
reload
- self.available = valid_framework?
- if self.available_changed?
- if self.available
- logger.warn "provider #{name} is now available"
- save!
- else
- logger.warn "provider #{name} is not available"
- update_attribute(:available, false)
- end
- end
# if the provider is not running, mark as unavailable and don't refresh its
# realms
- return unless self.available
+ return unless update_availability
conductor_acct_realms = {}
conductor_acct_realm_ids = {}
diff --git a/src/spec/controllers/provider_controller_spec.rb b/src/spec/controllers/provider_controller_spec.rb
index f7fac96..3098523 100644
--- a/src/spec/controllers/provider_controller_spec.rb
+++ b/src/spec/controllers/provider_controller_spec.rb
@@ -35,4 +35,19 @@ describe ProvidersController do
it { assigns[:realm_names].size.should == @provider.realms.size }
it { response.should render_template(:partial => "providers/_realms") }
end
+
+ describe "check availability" do
+ context "when provider is not accessible" do
+ before do
+ @provider.update_attribute(:url, "invalid_url")
+ end
+
+ it "should update availability status on test connection" do
+ @provider.available.should_not be_false
+ get :edit, :id => @provider.id, :test_provider => true
+ @provider.reload
+ @provider.available.should be_false
+ end
+ end
+ end
end
--
1.7.7.6
12 years, 2 months