This will keep Instances from dropping out of the 'in process'
list because agent returns 'created' rather than 'waiting'.
Instead, failed builds will go in their own table, which will
not appear if there are no failures.
---
src/app/controllers/templates_controller.rb | 1 +
src/app/models/image.rb | 4 ++--
src/app/views/templates/builds.haml | 12 ++++++++++++
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/app/controllers/templates_controller.rb
b/src/app/controllers/templates_controller.rb
index 97a8cec..ec31012 100644
--- a/src/app/controllers/templates_controller.rb
+++ b/src/app/controllers/templates_controller.rb
@@ -154,6 +154,7 @@ class TemplatesController < ApplicationController
def builds
@running_images = Image.all(:include => :template, :conditions => ['status
IN (?)', Image::ACTIVE_STATES])
@completed_images = Image.all(:include => :template, :conditions =>
{:status => Image::STATE_COMPLETE})
+ @failed_images = Image.all(:include => :template, :conditions => {:status
=> Image::STATE_FAILED})
require_privilege(Privilege::IMAGE_VIEW)
end
diff --git a/src/app/models/image.rb b/src/app/models/image.rb
index b1fa6d7..7bc5076 100644
--- a/src/app/models/image.rb
+++ b/src/app/models/image.rb
@@ -40,13 +40,13 @@ class Image < ActiveRecord::Base
SEARCHABLE_COLUMNS = %w(name)
STATE_QUEUED = 'queued'
- STATE_WAITING = 'waiting'
+ STATE_CREATED = 'created'
STATE_BUILDING = 'building'
STATE_COMPLETE = 'complete'
STATE_CANCELED = 'canceled'
STATE_FAILED = 'failed'
- ACTIVE_STATES = [ STATE_QUEUED, STATE_WAITING, STATE_BUILDING, STATE_FAILED ]
+ ACTIVE_STATES = [ STATE_QUEUED, STATE_CREATED, STATE_BUILDING ]
def self.new_if_not_exists(data)
unless find_by_template_id(data[:template_id], :conditions => {:target =>
data[:target]})
diff --git a/src/app/views/templates/builds.haml
b/src/app/views/templates/builds.haml
index 2da0031..4cba8b2 100644
--- a/src/app/views/templates/builds.haml
+++ b/src/app/views/templates/builds.haml
@@ -53,6 +53,18 @@
%td= img.template.architecture
%td= img.status
+ - unless @failed_images.empty?
+ %h1 Failed
+ %table
+ = sortable_table_header(columns)
+ %tbody
+ - @failed_images.each do |img|
+ %tr
+ %td= img.template.name
+ %td= img.template.platform
+ %td= img.template.platform_version
+ %td= img.template.architecture
+ %td= img.status
%h1 Completed
%table
--
1.7.2.3
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel