[PATCH aggregator] Advertise the section ID each page is under
by Tomas Sedovic
From: Tomas Sedovic <tsedovic(a)redhat.com>
We have four main sections: operation, administration, build and runtime.
Each has a different colour for the second-level navigation stripe.
Unfortunately, the current navigation system doesn't give us a way to find out
which section each view belongs to.
This makes the controllers to tell the views the current section. The views
can then set appropriate classes to the rendered objects.
---
src/app/controllers/image_controller.rb | 4 ++++
src/app/controllers/instance_controller.rb | 4 ++++
src/app/controllers/pools_controller.rb | 4 ++++
src/app/controllers/provider_controller.rb | 4 ++++
src/app/controllers/templates_controller.rb | 4 ++++
5 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/app/controllers/image_controller.rb b/src/app/controllers/image_controller.rb
index e399225..6e3f932 100644
--- a/src/app/controllers/image_controller.rb
+++ b/src/app/controllers/image_controller.rb
@@ -22,6 +22,10 @@
class ImageController < ApplicationController
before_filter :require_user
+ def section_id
+ 'build'
+ end
+
def index
end
diff --git a/src/app/controllers/instance_controller.rb b/src/app/controllers/instance_controller.rb
index c82d378..68d5e22 100644
--- a/src/app/controllers/instance_controller.rb
+++ b/src/app/controllers/instance_controller.rb
@@ -25,6 +25,10 @@ class InstanceController < ApplicationController
before_filter :require_user, :get_nav_items
layout :layout
+ def section_id
+ 'runtime'
+ end
+
def layout
return "aggregator" unless request.xhr?
end
diff --git a/src/app/controllers/pools_controller.rb b/src/app/controllers/pools_controller.rb
index 84523d7..ee95643 100644
--- a/src/app/controllers/pools_controller.rb
+++ b/src/app/controllers/pools_controller.rb
@@ -24,6 +24,10 @@ require 'util/condormatic'
class PoolsController < ApplicationController
before_filter :require_user, :get_nav_items
+ def section_id
+ 'administration'
+ end
+
def index
@header = [
{ :name => "Pool name", :sort_attr => :name },
diff --git a/src/app/controllers/provider_controller.rb b/src/app/controllers/provider_controller.rb
index 1bdbf86..61bdfdf 100644
--- a/src/app/controllers/provider_controller.rb
+++ b/src/app/controllers/provider_controller.rb
@@ -23,6 +23,10 @@ class ProviderController < ApplicationController
before_filter :require_user
before_filter :load_providers, :only => [:index, :show, :accounts, :list]
+ def section_id
+ 'administration'
+ end
+
def index
end
diff --git a/src/app/controllers/templates_controller.rb b/src/app/controllers/templates_controller.rb
index 78113bf..364bab5 100644
--- a/src/app/controllers/templates_controller.rb
+++ b/src/app/controllers/templates_controller.rb
@@ -4,6 +4,10 @@ class TemplatesController < ApplicationController
before_filter :require_user
before_filter :check_permission, :except => [:index, :builds]
+ def section_id
+ 'build'
+ end
+
def index
# TODO: add template permission check
require_privilege(Privilege::IMAGE_VIEW)
--
1.7.2.3
13 years, 7 months
[PATCH] Add a condormatic_instance_reset_error() method.
by Ian Main
This method is intended to be used to reset an error condition on an
instance. It calls condor_rm on the job in question so that a new job
can be started.
Signed-off-by: Ian Main <imain(a)redhat.com>
---
src/app/util/condormatic.rb | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/app/util/condormatic.rb b/src/app/util/condormatic.rb
index e051c24..0eac6cb 100644
--- a/src/app/util/condormatic.rb
+++ b/src/app/util/condormatic.rb
@@ -161,6 +161,10 @@ def condormatic_instance_stop(task)
Rails.logger.error("Error calling condor_rm (exit code #{$?}) on job: #{out}") if $? != 0
end
+def condormatic_instance_reset_error(task)
+ condormatic_instance_stop(task)
+end
+
def condormatic_instance_destroy(task)
instance = task.instance
--
1.7.2.3
13 years, 7 months
[PATCH] Add STATE_ERROR to the instance model and use it in dbomatic/condormatic.
by Ian Main
This patch uses STATE_ERROR instead of STATE_CREATE_FAILED for the
instance since condor uses a generic 'held' state to indicate an error.
At this time we are not parsing out the error information so really we
are setting a generic error about the instance rather than the special
case error of CREATE_FAILED.
Obviously we need better error messages and states but for now this at
least more accurately reflects the nature of the state.
Signed-off-by: Ian Main <imain(a)redhat.com>
---
src/app/models/instance.rb | 4 +++-
src/app/util/condormatic.rb | 2 +-
src/dbomatic/dbomatic | 14 +++++++++++---
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/app/models/instance.rb b/src/app/models/instance.rb
index 5f0c5f2..5ede90e 100644
--- a/src/app/models/instance.rb
+++ b/src/app/models/instance.rb
@@ -53,9 +53,11 @@ class Instance < ActiveRecord::Base
STATE_SHUTTING_DOWN = "shutting_down"
STATE_STOPPED = "stopped"
STATE_CREATE_FAILED = "create_failed"
+ STATE_ERROR = "error"
STATES = [STATE_NEW, STATE_PENDING, STATE_RUNNING,
- STATE_SHUTTING_DOWN, STATE_STOPPED, STATE_CREATE_FAILED]
+ STATE_SHUTTING_DOWN, STATE_STOPPED, STATE_CREATE_FAILED,
+ STATE_ERROR]
SEARCHABLE_COLUMNS = %w(name state)
diff --git a/src/app/util/condormatic.rb b/src/app/util/condormatic.rb
index 0eac6cb..9b678ee 100644
--- a/src/app/util/condormatic.rb
+++ b/src/app/util/condormatic.rb
@@ -106,7 +106,7 @@ def condor_to_instance_state(state_val)
when '4'
return Instance::STATE_STOPPED
when '5'
- return Instance::STATE_CREATE_FAILED
+ return Instance::STATE_ERROR
when '6'
return Instance::STATE_CREATE_FAILED
else
diff --git a/src/dbomatic/dbomatic b/src/dbomatic/dbomatic
index e013a5c..083d294 100755
--- a/src/dbomatic/dbomatic
+++ b/src/dbomatic/dbomatic
@@ -144,14 +144,22 @@ class CondorEventLog < Nokogiri::XML::SAX::Document
# However, it's not a state that we care to export to users, but it's
# also not an error, so we just silently ignore it.
elsif @trigger_type == "ULOG_JOB_HELD"
- # we failed to start the instance
+ # The job has some error condition.
+ #
# FIXME: if this happens, we probably want to add the HoldReason field
# to the database so we can display it to the user
# FIXME: we also may want to delete this job from condor, depending
# on the error. For instance, if you are trying to start an instance
# with a mismatched image and hardwareprofile architecture, the only
- # reasonable way out is to create a new instance. Needs thought
- inst.state = Instance::STATE_CREATE_FAILED
+ # reasonable way out is to create a new instance. Needs thought.
+ # - I've added a condormatic_instance_reset_error() method to reset
+ # error conditions such as this. In the future we should give different
+ # options based on the error condition.
+ # FIXME: Right now we don't parse out the HoldReason (or HoldReasonCode)
+ # so for now I'm going to set this to STATE_ERROR as there are multiple
+ # possible reasons for going into the 'held' state.
+
+ inst.state = Instance::STATE_ERROR
else
@logger.info "Unexpected trigger type #{@trigger_type}, not updating instance state"
return
--
1.7.2.3
13 years, 7 months
[PATCH] Get error messages from condor into the db.
by Ian Main
From: Jason Guiditta <jguiditt(a)redhat.com>
This patch teaches dbomatic how to get error messages into the database.
I added a 'last_error' field to the instance model so that we can stick
errors from condor in there.
Note that this is really not the right way to do this. We should be using
the event logging system and tying the errors back to the instance from
that. However this will work for now and give the users something
useful in case of an error.
Note that I haven't had a chance to test this patch live yet since my
setup is not working end to end yet.
Signed-off-by: Ian Main <imain(a)redhat.com>
---
src/app/util/condormatic.rb | 9 +++++++++
src/db/migrate/20090804142049_create_instances.rb | 1 +
src/dbomatic/dbomatic | 12 ++++++++----
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/src/app/util/condormatic.rb b/src/app/util/condormatic.rb
index 9b678ee..b003c57 100644
--- a/src/app/util/condormatic.rb
+++ b/src/app/util/condormatic.rb
@@ -128,17 +128,26 @@ def condormatic_instances_sync_states
doc = Nokogiri::XML(xml)
jobs_state = {}
+ jobs_error_msg = {}
doc.xpath('/classads/c').each do |jobs|
+ job_hold_reason = (v = jobs.at_xpath('./a[@n="HoldReason"]/s')) ? v.text : nil
job_name = (v = jobs.at_xpath('./a[@n="Cmd"]/s')) ? v.text : nil
job_state= (v = jobs.at_xpath('./a[@n="JobStatus"]/i')) ? v.text : nil
+ puts "job name is #{job_name}"
+ puts "job state is #{job_state}"
+ puts "hold reason is #{job_hold_reason}"
+
Rails.logger.info "job name is #{job_name}"
Rails.logger.info "job state is #{job_state}"
+ Rails.logger.info "hold reason is #{job_hold_reason}"
jobs_state[job_name] = condor_to_instance_state(job_state) if job_name
+ jobs_error_msg[job_name] = job_hold_reason if job_hold_reason
end
Instance.find(:all).each do |instance|
+ instance.last_error = jobs_error_msg[instance.condor_job_id] if jobs_error_msg.has_key?(instance.condor_job_id)
instance.state = jobs_state[instance.condor_job_id] || Instance::STATE_STOPPED
instance.save!
Rails.logger.info "Instance state updated to #{instance.state}"
diff --git a/src/db/migrate/20090804142049_create_instances.rb b/src/db/migrate/20090804142049_create_instances.rb
index b485031..e6ba245 100644
--- a/src/db/migrate/20090804142049_create_instances.rb
+++ b/src/db/migrate/20090804142049_create_instances.rb
@@ -34,6 +34,7 @@ class CreateInstances < ActiveRecord::Migration
t.string :private_address
t.string :state
t.string :condor_job_id
+ t.string :last_error
t.integer :instance_key_id
t.integer :lock_version, :default => 0
t.integer :acc_pending_time, :default => 0
diff --git a/src/dbomatic/dbomatic b/src/dbomatic/dbomatic
index 083d294..2a5211f 100755
--- a/src/dbomatic/dbomatic
+++ b/src/dbomatic/dbomatic
@@ -102,7 +102,7 @@ end
# Handle the event log's xml
class CondorEventLog < Nokogiri::XML::SAX::Document
- attr_accessor :tag, :event_type, :event_cmd, :event_time, :trigger_type, :grid_resource, :execute_host
+ attr_accessor :tag, :event_type, :event_cmd, :event_time, :trigger_type, :grid_resource, :execute_host, :hold_reason
def initialize(logger)
@logger = logger
@@ -128,6 +128,8 @@ class CondorEventLog < Nokogiri::XML::SAX::Document
@grid_resource = string
elsif @tag == "ExecuteHost"
@execute_host = string
+ elsif @tag == "HoldReason"
+ @hold_reason = string
end
end
end
@@ -146,8 +148,6 @@ class CondorEventLog < Nokogiri::XML::SAX::Document
elsif @trigger_type == "ULOG_JOB_HELD"
# The job has some error condition.
#
- # FIXME: if this happens, we probably want to add the HoldReason field
- # to the database so we can display it to the user
# FIXME: we also may want to delete this job from condor, depending
# on the error. For instance, if you are trying to start an instance
# with a mismatched image and hardwareprofile architecture, the only
@@ -158,7 +158,11 @@ class CondorEventLog < Nokogiri::XML::SAX::Document
# FIXME: Right now we don't parse out the HoldReason (or HoldReasonCode)
# so for now I'm going to set this to STATE_ERROR as there are multiple
# possible reasons for going into the 'held' state.
-
+ #
+ # FIXME: This only adds the error to the instance 'last_error' field. We
+ # should really be logging this information into the event log but that is not
+ # set up at this time so for now this will do.
+ inst.last_error = @hold_reason
inst.state = Instance::STATE_ERROR
else
@logger.info "Unexpected trigger type #{@trigger_type}, not updating instance state"
--
1.7.2.3
13 years, 7 months
[PATCH aggregator] Repository is displayed for selected packages on new template page
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
---
src/app/util/repository_manager.rb | 8 ++++++++
.../util/repository_manager/comps_repository.rb | 1 +
src/app/util/repository_manager/pulp_repository.rb | 1 +
src/app/views/templates/_managed_content.haml | 4 +++-
4 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/src/app/util/repository_manager.rb b/src/app/util/repository_manager.rb
index 11b6c5e..4f10a85 100644
--- a/src/app/util/repository_manager.rb
+++ b/src/app/util/repository_manager.rb
@@ -58,6 +58,14 @@ class RepositoryManager
return @all_packages
end
+ def repositories_hash
+ res = {}
+ @repositories.each do |r|
+ res[r.id] = r
+ end
+ res
+ end
+
private
def load_config
diff --git a/src/app/util/repository_manager/comps_repository.rb b/src/app/util/repository_manager/comps_repository.rb
index d7e192a..503b9af 100644
--- a/src/app/util/repository_manager/comps_repository.rb
+++ b/src/app/util/repository_manager/comps_repository.rb
@@ -31,6 +31,7 @@ class CompsRepository < AbstractRepository
name = g.at_xpath('name').text
groups[name] = {
:name => name,
+ :repository_id => @id,
:description => (t = g.at_xpath('description')) ? t.text : '',
:packages => pkgs,
}
diff --git a/src/app/util/repository_manager/pulp_repository.rb b/src/app/util/repository_manager/pulp_repository.rb
index 5641f0c..ef5cde1 100644
--- a/src/app/util/repository_manager/pulp_repository.rb
+++ b/src/app/util/repository_manager/pulp_repository.rb
@@ -56,6 +56,7 @@ class PulpRepository < AbstractRepository
name = info['name']
groups[name] = {
:name => name,
+ :repository_id => @id,
:description => info['description'].to_s,
:packages => pkgs,
}
diff --git a/src/app/views/templates/_managed_content.haml b/src/app/views/templates/_managed_content.haml
index 2ce8131..58dd331 100644
--- a/src/app/views/templates/_managed_content.haml
+++ b/src/app/views/templates/_managed_content.haml
@@ -4,10 +4,12 @@
%label.header.omega.grid_2.suffix_5 Repository:
%label.grid_2.alpha.clear Managed:
.grid_9.omega
+ - repos = @repository_manager.repositories_hash
- @tpl.xml.packages.each do |pkg|
+ - pkg_group = @groups.keys.find {|g| @groups[g][:packages][pkg[:name]]}
%fieldset
= text_field_tag 'packages[]', pkg[:name], :disabled => true, :id => "selected_package_#{pkg[:name]}", :class => "alpha grid_2"
- .grid_2 FIXME Repository
+ .grid_2= (pkg_group and repo = repos[@groups[pkg_group][:repository_id]]) ? repo.name.to_s : ' '
.grid_5.omega
%button{:type => 'button', :disabled => 'disabled'} Config
%button{:type => 'button', :disabled => 'disabled'} Metadata
--
1.7.2.3
13 years, 7 months
[PATCH aggregator] Changed package selection behavior
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
- packages/groups are selected on separate page by checkboxes
- when whole group is checked, only non-optional packages are selected
- packages which are already selected are checked and disabled in selection list
---
src/app/controllers/templates_controller.rb | 46 ++++++++-------
src/app/util/image_descriptor_xml.rb | 4 +-
src/app/util/repository_manager.rb | 20 ++++++
.../util/repository_manager/comps_repository.rb | 2 +-
src/app/util/repository_manager/pulp_repository.rb | 6 +-
src/app/views/templates/_content_selection.haml | 63 ++++++++++++--------
src/app/views/templates/_managed_content.haml | 1 +
src/app/views/templates/add_software_form.haml | 1 +
src/app/views/templates/new.haml | 3 -
src/features/template.feature | 15 ++---
10 files changed, 97 insertions(+), 64 deletions(-)
create mode 100644 src/app/views/templates/add_software_form.haml
diff --git a/src/app/controllers/templates_controller.rb b/src/app/controllers/templates_controller.rb
index 9361eff..37bf727 100644
--- a/src/app/controllers/templates_controller.rb
+++ b/src/app/controllers/templates_controller.rb
@@ -57,10 +57,20 @@ class TemplatesController < ApplicationController
# synchronize it at first to xml
@tpl.update_xml_attributes!(params[:tpl])
- # if add/remove pkg/group, we only update xml and render 'new' template
+ # if remove pkg, we only update xml and render 'new' template
# again
- if update_selection
- render :action => 'new'
+ params.keys.each do |param|
+ if param =~ /^remove_package_(.*)$/
+ update_group_or_package(:remove_package, $1, nil)
+ render :action => 'new'
+ return
+ end
+ end
+
+ if params[:add_software]
+ @repository_manager = RepositoryManager.new
+ @groups = @repository_manager.all_groups_with_tagged_selected_packages((a)tpl.xml.packages, params[:repository])
+ render :action => 'add_software_form'
return
end
@@ -75,6 +85,18 @@ class TemplatesController < ApplicationController
end
end
+ def add_software
+ @tpl = params[:template_id] ? Template.find(params[:template_id]) : Template.new(params[:template_id])
+ @repository_manager = RepositoryManager.new
+ @groups = @repository_manager.all_groups(params[:repository])
+ if params[:add_selected]
+ params[:groups].to_a.each { |group| @tpl.xml.add_group(group) }
+ params[:packages].to_a.each { |pkg| @tpl.xml.add_package(pkg, nil) }
+ @tpl.save_xml!
+ end
+ render :action => 'new'
+ end
+
def build_form
raise "select template to build" unless params[:image] and params[:image][:template_id]
@image = Image.new(params[:image])
@@ -133,24 +155,6 @@ class TemplatesController < ApplicationController
private
- def update_selection
- # TODO: don't know better way how to select package and also save other form data than
- # passing pkg/group as part of submit button name
- params.keys.each do |param|
- if param =~ /^select_package_(.*)$/
- update_group_or_package(:add_package, $1, nil)
- return true
- elsif param =~ /^remove_package_(.*)$/
- update_group_or_package(:remove_package, $1, nil)
- return true
- elsif param =~ /^select_group_(.*)$/
- update_group_or_package(:add_group, $1)
- return true
- end
- end
- return false
- end
-
def update_group_or_package(method, *args)
@repository_manager = RepositoryManager.new
@groups = @repository_manager.all_groups(params[:repository])
diff --git a/src/app/util/image_descriptor_xml.rb b/src/app/util/image_descriptor_xml.rb
index 28effb5..f437574 100644
--- a/src/app/util/image_descriptor_xml.rb
+++ b/src/app/util/image_descriptor_xml.rb
@@ -199,8 +199,8 @@ class ImageDescriptorXML
groups_node = get_or_create_node('groups')
add_group_node(groups_node, gname)
end
- group[:packages].each do |p, type|
- next if type == 'optional'
+ group[:packages].each do |p, info|
+ next if info[:type] == 'optional'
add_package(p, group[:name])
end
end
diff --git a/src/app/util/repository_manager.rb b/src/app/util/repository_manager.rb
index 11b6c5e..7ecaf35 100644
--- a/src/app/util/repository_manager.rb
+++ b/src/app/util/repository_manager.rb
@@ -58,6 +58,26 @@ class RepositoryManager
return @all_packages
end
+ def all_groups_with_tagged_selected_packages(pkgs, repository = nil)
+ groups = all_groups(repository)
+ groups.each_value do |group|
+ pkgs.each do |pkg|
+ next unless p = group[:packages][pkg[:name]]
+ p[:selected] = true
+ end
+ # if all non-optional packages are selected, mark all
+ # group as selected
+ group[:selected] = true
+ group[:packages].each_value do |pkg|
+ if pkg[:type] != 'optional' and !pkg[:selected]
+ group[:selected] = false
+ break
+ end
+ end
+ end
+ return groups
+ end
+
private
def load_config
diff --git a/src/app/util/repository_manager/comps_repository.rb b/src/app/util/repository_manager/comps_repository.rb
index d7e192a..9afe68b 100644
--- a/src/app/util/repository_manager/comps_repository.rb
+++ b/src/app/util/repository_manager/comps_repository.rb
@@ -74,7 +74,7 @@ class CompsRepository < AbstractRepository
def get_group_packages(group_node)
pkgs = {}
group_node.xpath('packagelist/packagereq').each do |p|
- pkgs[p.text] = p.attr('type')
+ (pkgs[p.text] ||= {})[:type] = p.attr('type')
end
return pkgs
end
diff --git a/src/app/util/repository_manager/pulp_repository.rb b/src/app/util/repository_manager/pulp_repository.rb
index 5641f0c..be6e72e 100644
--- a/src/app/util/repository_manager/pulp_repository.rb
+++ b/src/app/util/repository_manager/pulp_repository.rb
@@ -49,9 +49,9 @@ class PulpRepository < AbstractRepository
groups = {}
WrappedRestClient.get(@groups_url, HTTP_OPTS).each do |id, info|
pkgs = {}
- info['default_package_names'].each {|p| pkgs[p] = 'default'}
- info['optional_package_names'].each {|p| pkgs[p] = 'optional'}
- info['mandatory_package_names'].each {|p| pkgs[p] = 'mandatory'}
+ info['default_package_names'].each {|p| pkgs[p] = {:type => 'default'}}
+ info['optional_package_names'].each {|p| pkgs[p] = {:type => 'optional'}}
+ info['mandatory_package_names'].each {|p| pkgs[p] = {:type => 'mandatory'}}
next if pkgs.empty?
name = info['name']
groups[name] = {
diff --git a/src/app/views/templates/_content_selection.haml b/src/app/views/templates/_content_selection.haml
index 2ca99fe..f080f4a 100644
--- a/src/app/views/templates/_content_selection.haml
+++ b/src/app/views/templates/_content_selection.haml
@@ -1,31 +1,42 @@
%h3 Managed Content Selection
%h5 Search for Content
-= text_field_tag 'search', 'Search Text', :disabled => true
-%a Advanced Search
+- form_tag :action => "add_software" do
+ = text_field_tag 'search', 'Search Text', :disabled => true
+ = hidden_field_tag :template_id, @tpl.id
+ %a Advanced Search
-%p
- Repositories to Search:
- %a (Check all)
-%fieldset
- - @repository_manager.repositories.each do |repo|
- = check_box_tag 'repositories[]', repo.id, true
- = label_tag 'repositories[]', repo.name
-%fieldset
- .grid_3.alpha
- = radio_button_tag :show_mode, 'group', true
- = label_tag :show_mode, 'Show by Group'
- .grid_2.omega
- = radio_button_tag :show_mode, 'type', false, :disabled => true
- = label_tag :show_mode, 'Show by Type'
+ %p
+ Repositories to Search:
+ %a (Check all)
+ %fieldset
+ - @repository_manager.repositories.each do |repo|
+ = check_box_tag 'repositories[]', repo.id, true
+ = label_tag 'repositories[]', repo.name
+ %fieldset
+ .grid_3.alpha
+ = radio_button_tag :show_mode, 'group', true
+ = label_tag :show_mode, 'Show by Group'
+ .grid_2.omega
+ = radio_button_tag :show_mode, 'type', false, :disabled => true
+ = label_tag :show_mode, 'Show by Type'
-%ul.sidebarcontainer
- - @groups.keys.sort.each do |group|
- %li
- %h5.grid_4.alpha= group
- = submit_tag "Add", :name => "select_group_#{group}", :id => "select_group_#{group}", :class => "grid_1 omega"
- %ul
- - @groups[group][:packages].each do |pkg, type|
- %li
- %span.grid_4.alpha= pkg
- = submit_tag "Add", :name => "select_package_#{pkg}", :id => "select_package_#{pkg}", :class => "grid_1 omega"
+ = submit_tag "Add Selected", :name => "add_selected", :class => "dialogbutton"
+ = submit_tag "Cancel", :name => "cancel", :class => "dialogbutton"
+ %ul.sidebarcontainer
+ - @groups.keys.sort.each do |group|
+ - group_sel = @groups[group][:selected]
+ - group_id = group.gsub(/\s/, '_')
+ %li
+ = check_box_tag 'groups[]', group, group_sel, :disabled => group_sel, :id => "group_#{group_id}"
+ = label_tag "group_#{group_id}", group
+ %ul
+ - @groups[group][:packages].each do |pkg, info|
+ - pkg_sel = info[:selected] ? true : false
+ - pkg_id = pkg.gsub(/\s/, '_')
+ %li
+ = check_box_tag 'packages[]', pkg, pkg_sel, :disabled => pkg_sel, :id => "package_#{pkg_id}"
+ = label_tag "package_#{pkg_id}", pkg
+
+ = submit_tag "Add Selected", :name => "add_selected", :class => "dialogbutton"
+ = submit_tag "Cancel", :name => "cancel", :class => "dialogbutton"
diff --git a/src/app/views/templates/_managed_content.haml b/src/app/views/templates/_managed_content.haml
index 2ce8131..a769dbf 100644
--- a/src/app/views/templates/_managed_content.haml
+++ b/src/app/views/templates/_managed_content.haml
@@ -12,3 +12,4 @@
%button{:type => 'button', :disabled => 'disabled'} Config
%button{:type => 'button', :disabled => 'disabled'} Metadata
= submit_tag "Remove", :name => "remove_package_#{pkg[:name]}", :id => "remove_package_#{pkg[:name]}"
+ = submit_tag "Add Software", :name => "add_software"
diff --git a/src/app/views/templates/add_software_form.haml b/src/app/views/templates/add_software_form.haml
new file mode 100644
index 0000000..d32729a
--- /dev/null
+++ b/src/app/views/templates/add_software_form.haml
@@ -0,0 +1 @@
+= render :partial => 'content_selection'
diff --git a/src/app/views/templates/new.haml b/src/app/views/templates/new.haml
index fa82ce4..173549e 100644
--- a/src/app/views/templates/new.haml
+++ b/src/app/views/templates/new.haml
@@ -45,6 +45,3 @@
= submit_tag "Save", :name => "save", :class => "dialogbutton"
= submit_tag "Cancel", :name => "cancel", :class => "dialogbutton"
-
- .grid_5
- = render :partial => 'content_selection'
diff --git a/src/features/template.feature b/src/features/template.feature
index e9b4ed9..29d963e 100644
--- a/src/features/template.feature
+++ b/src/features/template.feature
@@ -22,23 +22,22 @@ Feature: Manage Templates
And I should see "Template saved"
And I should see "mocktemplate"
- Scenario: Add/Remove a package and a group to/from the template
+ Scenario: Add group and remove package to/from the template
Given I am on the templates page
When I press "Template"
Then I should be on the new template page
When I fill in the following:
| tpl_name | mocktemplate |
- And I press "select_package_jboss-as5"
- Then I should be on the create template page
+ And I press "Add Software"
+ Then I should see "Managed Content Selection"
+ When I check "group_JBoss_Core_Packages"
+ And I press "Add Selected"
+ Then I should see "Managed Content to Bundle"
And the "tpl[name]" field by name should contain "mocktemplate"
And the page should contain "#selected_package_jboss-as5" selector
When I press "remove_package_jboss-as5"
- Then I should be on the create template page
+ Then I should see "Managed Content to Bundle"
And the page should not contain "#selected_package_jboss-as5" selector
- When I press "select_group_JBoss Core Packages"
- Then I should be on the create template page
- And the "tpl[name]" field by name should contain "mocktemplate"
- And the page should contain "#selected_package_jboss-jgroups" selector
When I press "Save"
Then I should be on the templates page
And I should see "Template saved"
--
1.7.2.3
13 years, 7 months
[PATCH docs 1/1] BZ 628016: Fix wording
by Mike Orazi
---
docs/api.mdown | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/docs/api.mdown b/docs/api.mdown
index f0822a3..ba3bea8 100644
--- a/docs/api.mdown
+++ b/docs/api.mdown
@@ -167,7 +167,7 @@ An _image_ is a platonic form of a machine. Images are not directly
executable, but are a template for creating actual instances of
machines.
-The instances collection will return a set of all images available to
+The images collection will return a set of all images available to
the current user.
<images>
--
1.7.2.3
13 years, 7 months
[PATCH] Add configure check for classads-devel.
by Ian Main
Add a quick check in configure for classads-devel so developers can be
alerted better that they need the classads-devel rpm.
Signed-off-by: Ian Main <imain(a)redhat.com>
---
configure.ac | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1f1c212..38864c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,6 +8,8 @@ AC_PROG_CC
AC_PROG_LIBTOOL
AC_LANG([C++])
+AC_CHECK_HEADER(classad/classad_distribution.h,,AC_MSG_ERROR([Cannot find headers for classads. Please install classads-devel rpm.]))
+
AC_ARG_ENABLE(local,
[ --enable-local Set this flag if you are planning to run the aggregator without installing it.],
[ DELTACLOUD_INSTALL_DIR=`pwd`/src ], [ DELTACLOUD_INSTALL_DIR=$pkgdatadir ])
--
1.7.2.3
13 years, 7 months
[PATCH] Look for classads header in configure.ac.
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
configure.ac | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1f1c212..9076b2d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,26 @@ AC_ARG_ENABLE(local,
[ DELTACLOUD_INSTALL_DIR=`pwd`/src ], [ DELTACLOUD_INSTALL_DIR=$pkgdatadir ])
AC_SUBST(DELTACLOUD_INSTALL_DIR)
+dnl
+dnl check for classads-devel
+dnl
+
+CLASSADS_REQUIRED=1.0.4
+
+AC_ARG_WITH([classads], AC_HELP_STRING([--with-classads=@<:@PFX@:>@],
+ [classads location]))
+
+if test "x$with_classads" = xno ; then
+ AC_MSG_CHECKING([for classads libraries >= $CLASSADS_REQUIRED])
+ AC_MSG_ERROR([classads >= $CLASSADS_REQUIRED is required for aggregator])
+elif test "x$with_classads" = "x"; then
+ fail=0
+ AC_CHECK_HEADERS([classad/classad_distribution.h],, [fail=1],[])
+ if test $fail = 1; then
+ AC_MSG_ERROR([You must install the classads development package to compile the aggregator])
+ fi
+fi
+
# If using gcc and default CFLAGS, enable some warnings.
test x"$ac_ct_CC:$CFLAGS" = 'xgcc:-g -O2' \
&& CFLAGS="$CFLAGS -Wshadow -Wall -Werror"
--
1.7.2.3
13 years, 7 months