[PATCH conductor] Added pagination to events on instance detail page
by Imre Farkas
From: Imre Farkas <ifarkas(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=743605
---
src/app/controllers/instances_controller.rb | 1 +
src/app/models/event.rb | 2 ++
src/app/views/instances/_history.html.haml | 4 +++-
3 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/app/controllers/instances_controller.rb b/src/app/controllers/instances_controller.rb
index c493fd0..95cf35d 100644
--- a/src/app/controllers/instances_controller.rb
+++ b/src/app/controllers/instances_controller.rb
@@ -44,6 +44,7 @@ class InstancesController < ApplicationController
@tab_captions = [t('instances.tab_captions.properties'), t('instances.tab_captions.history'), t('instances.tab_captions.permissions')]
@details_tab = params[:details_tab].blank? ? 'properties' : params[:details_tab]
save_breadcrumb(instance_path(@instance), @instance.name)
+ @events = @instance.events.descending_by_created_at.paginate(:page => params[:page] || 1)
respond_to do |format|
format.html { render :action => 'show'}
format.js do
diff --git a/src/app/models/event.rb b/src/app/models/event.rb
index 6beb7c3..1855014 100644
--- a/src/app/models/event.rb
+++ b/src/app/models/event.rb
@@ -46,6 +46,7 @@ class Event < ActiveRecord::Base
attr_accessor :change_hash # allows us to pass in .changes on the parent ("source") object
scope :lifetime, where(:status_code => [:first_running, :all_running, :some_running, :all_stopped])
+ scope :descending_by_created_at, order('created_at DESC')
# Notifies the Event API if certain conditions are met
def transmit_event
@@ -117,4 +118,5 @@ class Event < ActiveRecord::Base
def change_hash
@change_hash || {}
end
+
end
diff --git a/src/app/views/instances/_history.html.haml b/src/app/views/instances/_history.html.haml
index c4e3349..2facfc3 100644
--- a/src/app/views/instances/_history.html.haml
+++ b/src/app/views/instances/_history.html.haml
@@ -2,7 +2,9 @@
= t 'instances.history.history_for'
= @instance.name
%ul
- - @instance.events.each do |event|
+ - @events.each do |event|
%li
= @instance.name
= event.summary
+
+= will_paginate @events
--
1.7.6.4
12 years, 4 months
[PATCH Conductor] Add ability to delete deployment configurations from config server
by Greg Blomquist
With this patch, deleting a deployment invokes a call to the config server
associated with the deployment to delete the configurations for the deployment.
Assumptions:
* If any of the instances in the deployment have user_data, then a config
server was associated with the deployment
* All of the instances in the deployment were launched in the same provider
account (and therefore, used the same config server)
Also, this patch ignores 404s from the config server when deleting deployment
configurations in case an administrator manually deleted the deployment
configurations from the config server already.
This patch requires a config server with version 0.4.2 or higher.
12 years, 4 months
[PATCH aeolus-conductor] Added account info on provider image, partial fix BZ750214
by Maros Zatko
From: Maros Zatko <mzatko(a)redhat.com>
---
lib/aeolus_cli/command/list_command.rb | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/lib/aeolus_cli/command/list_command.rb b/lib/aeolus_cli/command/list_command.rb
index fbc4ee4..deea9a2 100644
--- a/lib/aeolus_cli/command/list_command.rb
+++ b/lib/aeolus_cli/command/list_command.rb
@@ -40,7 +40,7 @@ module Aeolus
headers = ActiveSupport::OrderedHash.new
headers[:id] = "ID"
headers[:image] = "Image"
- collection = @options[:id].nil? ? Aeolus::CLI::Build.all : Aeolus::CLI::Build.find(:all, :from => Aeolus::CLI::Base.site.path + "/images/" + @options[:id] + "/builds.xml")
+ collection = @options[:id] == 'all' ? Aeolus::CLI::Build.all : Aeolus::CLI::Build.find(:all, :from => Aeolus::CLI::Base.site.path + "/images/" + @options[:id] + "/builds.xml")
print_collection(collection, headers)
quit(0)
rescue => e
@@ -54,7 +54,7 @@ module Aeolus
headers[:id] = "ID"
headers[:status] = "Status"
headers[:build] = "Build"
- collection = @options[:id].nil? ? Aeolus::CLI::TargetImage.all : Aeolus::CLI::TargetImage.find(:all, :from => Aeolus::CLI::Base.site.path + "/builds/" + @options[:id] + "/target_images.xml")
+ collection = @options[:id] == 'all' ? Aeolus::CLI::TargetImage.all : Aeolus::CLI::TargetImage.find(:all, :from => Aeolus::CLI::Base.site.path + "/builds/" + @options[:id] + "/target_images.xml")
print_collection(collection, headers)
quit(0)
rescue => e
@@ -70,7 +70,19 @@ module Aeolus
headers[:provider] = "Provider"
headers[:status] = "Status"
headers[:target_image] = "Target Image"
- collection = @options[:id].nil? ? Aeolus::CLI::ProviderImage.all : Aeolus::CLI::ProviderImage.find(:all, :from => Aeolus::CLI::Base.site.path + "/target_images/" + @options[:id] + "/provider_images.xml")
+ headers[:account_name] = "Provider Name"
+ headers[:account_type] = "Provider Type"
+ collection = @options[:id] == 'all' ? Aeolus::CLI::ProviderImage.all : Aeolus::CLI::ProviderImage.find(:all, :from => Aeolus::CLI::Base.site.path + "/target_images/" + @options[:id] + "/provider_images.xml")
+
+ paccs = Aeolus::CLI::ProviderAccount.all.group_by(&:provider)
+
+ collection.map do |item|
+ prov = item.attributes[:provider]
+ item.attributes[:account_name] = paccs[prov].first.name
+ item.attributes[:account_type] = paccs[prov].first.provider_type
+ item
+ end
+
print_collection(collection, headers)
quit(0)
rescue => e
--
1.7.7.3
12 years, 4 months
[PATCH conductor] Fixing aeolus-conductor.spec.in
by Imre Farkas
From: Imre Farkas <ifarkas(a)redhat.com>
---
aeolus-conductor.spec.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/aeolus-conductor.spec.in b/aeolus-conductor.spec.in
index ba18823..79e8c3f 100644
--- a/aeolus-conductor.spec.in
+++ b/aeolus-conductor.spec.in
@@ -138,7 +138,7 @@ haml="app/views/hardware_profiles app/views/realm_mappings \
app/views/quotas app/views/permissions \
app/views/deployments app/views/pools \
app/views/instances app/views/user_sessions \
- app/views/catalog_entries app/views/catalogs \
+ app/views/deployables app/views/catalogs \
app/views/provider_types app/views/api/images \
app/views/config_servers \
app/views/api/hooks \
--
1.7.6.4
12 years, 4 months
Android Deltacloud App
by Martyn Taylor
Hi people,
I wrote a native Deltacloud Android App a while back but didn't get
round to sending it out, I thought now is as good of a time as any to
get it out there.
You can download the app from here:
http://martyntaylor.fedorapeople.org/dcdroid.apk
Please check it out, there are one or two minor issues atm. But all in
all it does the job. Please drop me aline if people have
suggestions/bugs etc... I will get round to setting up a Redmine/BZ
project soon.
One Note: The app uses the older style "one DC Instance per provider"
format (Since I wrote the Android client way before the newer format was
introduced).
Also, I've only tested this on a handful of displays though I written it
to be compatible with most (though it might not look so great).
Have fun
Martyn
12 years, 4 months
[PATCH 0/3] Event API back end for syslog
by Jason Guiditta
This patchset implements the feature in $subject, Redmine feature:
https://www.aeolusproject.org/redmine/issues/2509
I am resending patch 1 due to no feedback on previous send. There is
a minor change to calling process on an event, in that if you wish to
specify a converter, you pass in an object, rather than a magic string.
However, this causes no change on the default call (syslog), it merely
opens up an easy way to later pass in custom-configured converters. For
instance, we may want to allow the app/user to specify a different facility
or ident which is different from the default we are using now.
Once again, tests can be run with:
rspec spec/aeolus/event/*.rb --format doc
[PATCH conductor 1/3] RM #2822: Add way to retrieve full list of
[PATCH conductor 2/3] Redmine #2514: Write and test transformation
[PATCH conductor 3/3] Redmine #2515: Write and test actual logging
-j
12 years, 4 months
[PATCH] Deploaybles and catalog_entries cleanups
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
Hi, after yesterday's renaming of catalog_entries and deployables there is
still mess in current views and controllers - this should be cleaned up before building
rpms. I started with it, but apparently won't be able to finish this today.
This patch is in the middle of renaming and cleaning, if you have time, feel free to
continue on this.
Jan
---
src/app/controllers/deployables_controller.rb | 116 ++++++++++----------
src/app/views/deployables/_form.html.haml | 35 +++---
src/app/views/deployables/_from_url.html.haml | 21 ++--
src/app/views/deployables/_list.html.haml | 10 +-
.../views/deployables/_new_from_image.html.haml | 14 +-
src/app/views/deployables/_upload.html.haml | 29 +++---
src/app/views/deployables/show.html.haml | 10 +-
7 files changed, 116 insertions(+), 119 deletions(-)
diff --git a/src/app/controllers/deployables_controller.rb b/src/app/controllers/deployables_controller.rb
index c5e7a4e..46d48cf 100644
--- a/src/app/controllers/deployables_controller.rb
+++ b/src/app/controllers/deployables_controller.rb
@@ -26,18 +26,18 @@ class DeployablesController < ApplicationController
@deployables = Deployable.list_for_user(current_user, Privilege::VIEW)
@catalog_entries = @deployables.collect { |d| d.catalog_entries.first }
#@catalog_entries = CatalogEntry.list_for_user(current_user, Privilege::VIEW).apply_filters(:preset_filter_id => params[:catalog_entries_preset_filter], :search_filter => params[:catalog_entries_search])
- @catalog = @catalog_entries.first.catalog unless @catalog_entries.empty?
+ @catalog = Catalog.find(params[:catalog_id]) #(a)catalog_entries.first.catalog unless @catalog_entries.empty?
set_header
end
def new
- @catalog_entry = params[:catalog_entry].nil? ? CatalogEntry.new() : CatalogEntry.new(params[:catalog_entry])
- @catalog_entry.deployable = Deployable.new unless @catalog_entry.deployable
+ @deployable = Deployable.new(params[:deployable])
require_privilege(Privilege::CREATE, Deployable)
if params[:create_from_image]
@image = Aeolus::Image::Warehouse::Image.find(params[:create_from_image])
@hw_profiles = HardwareProfile.frontend.list_for_user(current_user, Privilege::VIEW)
- @catalog_entry.deployable.name = @image.name
+ @deployable.name = @image.name
+ @selected_catalogs = params[:catalog_id].to_a
load_catalogs
else
@catalog = Catalog.find(params[:catalog_id])
@@ -51,13 +51,14 @@ class DeployablesController < ApplicationController
end
def show
- @catalog_entry = CatalogEntry.find(params[:id])
- require_privilege(Privilege::VIEW, @catalog_entry.deployable)
- save_breadcrumb(catalog_deployable_path((a)catalog_entry.catalog, @catalog_entry), @catalog_entry.deployable.name)
+ @deployable = Deployable.find(params[:id])
+ @catalog = params[:catalog_id]
+ require_privilege(Privilege::VIEW, @deployable)
+ save_breadcrumb(catalog_deployable_path(@catalog, @deployable), @deployable.name)
@providers = Provider.all
- @catalogs_options = Catalog.all.map {|c| [c.name, c.id] unless c == @catalog_entry.catalog}.compact
- add_permissions_inline((a)catalog_entry.deployable)
- @image_details = @catalog_entry.deployable.get_image_details
+ @catalogs_options = Catalog.all.map {|c| [c.name, c.id] unless c == @catalog}.compact
+ add_permissions_inline(@deployable)
+ @image_details = @deployable.get_image_details
@image_details.each do |assembly|
assembly.keys.each do |key|
flash[:error] = assembly[key] if key.to_s =~ /^error\w+/
@@ -71,69 +72,71 @@ class DeployablesController < ApplicationController
return
end
-
- @catalog_entry = CatalogEntry.new(params[:catalog_entry])
- if params[:create_from_image].present?
- @catalog = @catalog_entry.catalog
- @catalog_entry.deployable = Deployable.new unless @catalog_entry.deployable
- else
- @catalog = Catalog.find(params[:catalog_id])
- @catalog_entry.catalog = @catalog
- end
- require_privilege(Privilege::MODIFY, @catalog)
require_privilege(Privilege::CREATE, Deployable)
- @catalog_entry.deployable.owner = current_user
+ @deployable = Deployable.new(params[:deployable])
+ @selected_catalogs = params[:catalog_id].to_a
+ @deployable.owner = current_user
if params.has_key? :url
xml = import_xml_from_url(params[:url])
unless xml.nil?
#store xml_filename for url (i.e. url ends to: foo || foo.xml)
- @catalog_entry.deployable.xml_filename = File.basename(URI.parse(params[:url]).path)
- @catalog_entry.deployable.xml = xml
+ @deployable.xml_filename = File.basename(URI.parse(params[:url]).path)
+ @deployable.xml = xml
end
elsif params[:create_from_image].present?
hw_profile = HardwareProfile.frontend.find(params[:hardware_profile])
require_privilege(Privilege::VIEW, hw_profile)
- @catalog_entry.deployable.set_from_image(params[:create_from_image], hw_profile)
+ @deployable.set_from_image(params[:create_from_image], hw_profile)
end
- if @catalog_entry.save
- flash[:notice] = t "catalog_entries.flash.notice.added"
- if params[:edit_xml]
- redirect_to edit_catalog_deployable_path @catalog_entry.catalog.id, @catalog_entry.id, :edit_xml =>true
- else
- redirect_to catalog_deployables_path(@catalog)
+ begin
+ @deployable.transaction do
+ raise t("catalog_entries.flash.error.no_catalog") if @selected_catalogs.empty?
+ @deployable.save!
+ @selected_catalogs.each do |cid|
+ catalog = Catalog.find(cid)
+ require_privilege(Privilege::MODIFY, catalog)
+ CatalogEntry.create!(:catalog_id => cid, :deploayble_id => @deployable.id)
+ end
+ flash[:notice] = t "catalog_entries.flash.notice.added"
+ if params[:edit_xml]
+ redirect_to edit_catalog_deployable_path @selected_catalogs.first.id, @deployable.id, :edit_xml =>true
+ else
+ redirect_to catalog_deployables_path((a)selected_catalogs.first)
+ end
end
- else
- flash[:warning]= t('catalog_entries.flash.warning.not_valid') if @catalog_entry.errors.has_key?(:xml)
+ rescue => e
+ flash[:warning]= t('catalog_entries.flash.warning.create_failed', :message => e.message)
+ flash[:warning]= t('catalog_entries.flash.warning.not_valid') if @deployable.errors.has_key?(:xml)
if params[:create_from_image].present?
load_catalogs
@image = Aeolus::Image::Warehouse::Image.find(params[:create_from_image])
@hw_profiles = HardwareProfile.frontend.list_for_user(current_user, Privilege::VIEW)
- @catalog_entry.deployable.name = @image.name
+ @deployable.name = @image.name
else
+ @catalog = Catalog.find((a)selected_catalogs.first)
params.delete(:edit_xml) if params[:edit_xml]
- @form_option = params[:catalog_entry].has_key?(:xml) ? 'upload' : 'from_url'
- @form_option = params[:catalog_entry][:deployable].has_key?(:xml) ? 'upload' : 'from_url'
+ @form_option = params[:deployable].has_key?(:xml) ? 'upload' : 'from_url'
end
render :new
end
end
def edit
- @catalog_entry = CatalogEntry.find(params[:id])
- require_privilege(Privilege::MODIFY, @catalog_entry.deployable)
- @catalog = @catalog_entry.catalog
+ @deployable = Deployable.find(params[:id])
+ require_privilege(Privilege::MODIFY, @deployable)
+ @catalog = params[:catalog_id]
end
def update
- @catalog_entry = CatalogEntry.find(params[:id])
- require_privilege(Privilege::MODIFY, @catalog_entry.deployable)
- params[:catalog_entry][:deployable].delete(:owner_id) if params[:catalog_entry] and params[:catalog_entry][:deployable]
+ @deployable = Deployable.find(params[:id])
+ require_privilege(Privilege::MODIFY, @deployable)
+ params[:deployable].delete(:owner_id) if params[:deployable]
- if @catalog_entry.update_attributes(params[:catalog_entry])
+ if @deployable.update_attributes(params[:deployable])
flash[:notice] = t"catalog_entries.flash.notice.updated"
- redirect_to catalog_deployable_path((a)catalog_entry.catalog, @catalog_entry)
+ redirect_to catalog_deployable_path(params[:catalog_id], @deployable)
else
render :action => 'edit'
end
@@ -141,28 +144,25 @@ class DeployablesController < ApplicationController
def multi_destroy
@catalog = nil
- CatalogEntry.find(params[:catalog_entries_selected]).to_a.each do |d|
- require_privilege(Privilege::MODIFY, d.catalog)
- require_privilege(Privilege::MODIFY, d.deployable)
- @catalog = d.catalog
- # Don't do this when we're managing deployables independently
- d.deployable.destroy
+ Deployable.find(params[:deployables_selected]).to_a.each do |d|
+ # TODO: delete only in catalogs where I have permission to
+ #require_privilege(Privilege::MODIFY, d.catalog)
+ require_privilege(Privilege::MODIFY, d)
+ #@catalog = d.catalog
d.destroy
end
- redirect_to catalog_path(@catalog)
+ redirect_to catalog_path(params[:catalog_id])
end
def destroy
- catalog_entry = CatalogEntry.find(params[:id])
- require_privilege(Privilege::MODIFY, catalog_entry.catalog)
- require_privilege(Privilege::MODIFY, catalog_entry.deployable)
- @catalog = catalog_entry.catalog
- # Don't do this when we're managing deployables independently
- catalog_entry.deployable.destroy
- catalog_entry.destroy
+ deployable = Deployable.find(params[:id])
+ # TODO: delete only in catalogs where I have permission to
+ #require_privilege(Privilege::MODIFY, catalog_entry.catalog)
+ require_privilege(Privilege::MODIFY, deployable)
+ destroy
respond_to do |format|
- format.html { redirect_to catalog_path(@catalog) }
+ format.html { redirect_to catalog_path(params[:catalog_id]) }
end
end
diff --git a/src/app/views/deployables/_form.html.haml b/src/app/views/deployables/_form.html.haml
index d638684..c53eb61 100644
--- a/src/app/views/deployables/_form.html.haml
+++ b/src/app/views/deployables/_form.html.haml
@@ -1,26 +1,25 @@
-- if @catalog_entry.errors.any?
- = render 'layouts/error_messages', :object => @catalog_entry
+- if @deployable.errors.any?
+ = render 'layouts/error_messages', :object => @deployable
%fieldset
+ = form_for @deployable do |form|
- if params[:edit_xml]
- = form.fields_for :deployable, @catalog_entry.deployable do |deployable_fields|
- %p
- = deployable_fields.label :xml, t('.deployable_xml')
- = deployable_fields.text_area :xml, :class => 'long'
+ %p
+ = form.label :xml, t('.deployable_xml')
+ = form.text_area :xml, :class => 'long'
- else
%p
- = form.label :catalog_id, t('catalog_entries.form.catalog')
- = @catalog ? @catalog.name : @catalog_entry.catalog.name
+ = label_tag :catalog_id, t('catalog_entries.form.catalog')
+ = @catalog.name
.clear
- = form.fields_for :deployable, @catalog_entry.deployable do |deployable_fields|
- %p
- = deployable_fields.label :name, t('catalog_entries.index.name')
- = deployable_fields.text_field :name, :class => 'em long'
- %p
- = deployable_fields.label :description, t('.description')
- = deployable_fields.text_area :description, :class => 'long'
- %p
- = deployable_fields.label :xml, t('.deployable_xml')
- = link_to t("catalog_entries.properties.edit_deployable_xml"), edit_catalog_deployable_path((a)catalog_entry.catalog.id, @catalog_entry.id, :edit_xml=>true)
+ %p
+ = form.label :name, t('catalog_entries.index.name')
+ = form.text_field :name, :class => 'em long'
+ %p
+ = form.label :description, t('.description')
+ = form.text_area :description, :class => 'long'
+ %p
+ = form.label :xml, t('.deployable_xml')
+ = link_to t("catalog_entries.properties.edit_deployable_xml"), edit_catalog_deployable_path((a)catalog.id, @deployable.id, :edit_xml=>true)
%fieldset.options
= link_to t('cancel'), catalog_path(@catalog), :class => 'button danger'
diff --git a/src/app/views/deployables/_from_url.html.haml b/src/app/views/deployables/_from_url.html.haml
index 22b0099..d351ecb 100644
--- a/src/app/views/deployables/_from_url.html.haml
+++ b/src/app/views/deployables/_from_url.html.haml
@@ -1,19 +1,18 @@
-= form_for @catalog_entry, :url => catalog_deployables_path(@catalog), :html => {:class => 'generic', :multipart => true } do |form|
- - if @catalog_entry.errors.any?
- = render 'layouts/error_messages', :object => @catalog_entry
+= form_for @deployable, :url => catalog_deployables_path(@catalog), :html => {:class => 'generic', :multipart => true } do |form|
+ - if @deployable.errors.any?
+ = render 'layouts/error_messages', :object => @deployable
%fieldset
%p
= form.label :catalog_id, t('catalog_entries.form.catalog')
%span.text_instead_input= @catalog.name
.clear
- =form.fields_for :deployable, @catalog_entry.deployable do |deployable_fields|
- %fieldset
- %p
- = deployable_fields.label :name, t('catalog_entries.index.name')
- = deployable_fields.text_field :name, :class => 'em long'
- %p
- = deployable_fields.label :description, t('catalog_entries.form.description')
- = deployable_fields.text_area :description, :class => 'long'
+ %fieldset
+ %p
+ = form.label :name, t('catalog_entries.index.name')
+ = form.text_field :name, :class => 'em long'
+ %p
+ = form.label :description, t('catalog_entries.form.description')
+ = form.text_area :description, :class => 'long'
%fieldset
%p
= label_tag :url, t('catalog_entries.form.deployable_xml_url')
diff --git a/src/app/views/deployables/_list.html.haml b/src/app/views/deployables/_list.html.haml
index 117e636..350ad4f 100644
--- a/src/app/views/deployables/_list.html.haml
+++ b/src/app/views/deployables/_list.html.haml
@@ -25,14 +25,14 @@
});
});
- = filter_table(@header, @catalog_entries) do |catalog_entry|
+ = filter_table(@header, @deployables) do |deployable|
%tr{:class => cycle('nostripe','stripe')}
%td{:class => 'checkbox'}
- selected = params[:select] == 'all'
- = check_box_tag "catalog_entries_selected[]", catalog_entry.id, selected, :id => "catalog_entry_checkbox_#{catalog_entry.id}"
+ = check_box_tag "deployables_selected[]", deployable.id, selected, :id => "deployable_checkbox_#{deployable.id}"
%td
- = link_to catalog_entry.deployable.name, catalog_deployable_path(@catalog, catalog_entry.id)
+ = link_to deployable.name, catalog_deployable_path(@catalog, deployable.id)
%td
- = link_to catalog_entry.catalog.name, catalog_entry.catalog
+ = link_to @catalog.name, @catalog
%td
- = link_to catalog_entry.deployable.xml_filename, catalog_deployable_path(@catalog, catalog_entry.id)
+ = link_to deployable.xml_filename, catalog_deployable_path(@catalog, deployable.id)
diff --git a/src/app/views/deployables/_new_from_image.html.haml b/src/app/views/deployables/_new_from_image.html.haml
index f546698..95ffc7d 100644
--- a/src/app/views/deployables/_new_from_image.html.haml
+++ b/src/app/views/deployables/_new_from_image.html.haml
@@ -1,12 +1,12 @@
%header.admin-page-header
- %h1.deployables= t('.catalog_entry_name', :name => @catalog_entry.deployable.name)
+ %h1.deployables= t('.catalog_entry_name', :name => @deployable.name)
%section.admin-content-section
.content.buildpush
- = form_for @catalog_entry, :html => {:class => 'generic'} do |form|
+ = form_for @deployable, :html => {:class => 'generic'} do |form|
= hidden_field_tag :create_from_image, params[:create_from_image]
- - if @catalog_entry.errors.any?
- = render 'layouts/error_messages', :object => @catalog_entry
+ - if @deployable.errors.any?
+ = render 'layouts/error_messages', :object => @deployable
.lefted.new-catalog-entry-from-image
%h2= t('.title')
%p= t('.description', :name => @image.name)
@@ -17,8 +17,8 @@
.clear
%div
= form.label :catalog_id, t('catalog_entries.form.catalog')
- = form.select :catalog_id, @catalogs.collect{|c| [c.name, c.id]}
- %span.text_instead_input= "Catalog1"
+ /= form.select :catalog_id, @catalogs.collect{|c| [c.name, c.id]}
+ %span.text_instead_input= @selected_catalogs.empty? ? t('deployables.form.none') : @selected_catalogs.count > 1 ? t('deployables.form.multiple') : @selected_catalogs.first
%span.catalog_link
 
%div.catalog_list
@@ -26,7 +26,7 @@
- @catalogs.each do |catalog|
%li.catalog
.catalog_with_checkbox
- = check_box_tag :catalog_ids
+ = check_box_tag :catalog_id, @selected_catalogs.include?(catalog.id)
= catalog.name
.clear
.clear
diff --git a/src/app/views/deployables/_upload.html.haml b/src/app/views/deployables/_upload.html.haml
index 475d492..6afaa8f 100644
--- a/src/app/views/deployables/_upload.html.haml
+++ b/src/app/views/deployables/_upload.html.haml
@@ -1,22 +1,21 @@
-= form_for @catalog_entry, :url => catalog_deployables_path(@catalog), :html => {:class => 'generic', :multipart => true } do |form|
- - if @catalog_entry.errors.any?
- = render 'layouts/error_messages', :object => @catalog_entry
+= form_for @deployable, :url => catalog_deployables_path(@catalog), :html => {:class => 'generic', :multipart => true } do |form|
+ - if @deployable.errors.any?
+ = render 'layouts/error_messages', :object => @deployable
%fieldset
%p
- = form.label :catalog_id, t('catalog_entries.form.catalog')
+ = label_tag :catalog_id, t('catalog_entries.form.catalog')
%span.text_instead_input= @catalog.name
.clear
- = form.fields_for :deployable, @catalog_entry.deployable do |deployable_fields|
- %fieldset
- %p
- = deployable_fields.label :name, t('catalog_entries.index.name')
- = deployable_fields.text_field :name, :class => 'em long'
- %p
- = deployable_fields.label :description, t('catalog_entries.form.description')
- = deployable_fields.text_area :description, :class => 'long'
- %p
- = deployable_fields.label :xml, t('catalog_entries.form.choose_xml')
- = deployable_fields.file_field :xml
+ %fieldset
+ %p
+ = form.label :name, t('catalog_entries.index.name')
+ = form.text_field :name, :class => 'em long'
+ %p
+ = form.label :description, t('catalog_entries.form.description')
+ = form.text_area :description, :class => 'long'
+ %p
+ = form.label :xml, t('catalog_entries.form.choose_xml')
+ = form.file_field :xml
%fieldset
%p
= check_box_tag(:edit_xml, true, false)
diff --git a/src/app/views/deployables/show.html.haml b/src/app/views/deployables/show.html.haml
index 1eab46e..fa5ec42 100644
--- a/src/app/views/deployables/show.html.haml
+++ b/src/app/views/deployables/show.html.haml
@@ -1,12 +1,12 @@
= render :partial => 'layouts/admin_nav'
%header.admin-page-header
- %h1{:class => controller.controller_name}= @catalog_entry.deployable.name
+ %h1{:class => controller.controller_name}= @deployable.name
#obj_actions.button-container
.button-group
- = button_to t('catalog_entries.show.delete'), catalog_deployable_path((a)catalog_entry.catalog, @catalog_entry), :method => 'delete', :confirm => "#{t'catalog_entries.show.confirm_delete'}", :class => 'button danger', :id => 'delete'
- = link_to t('catalog_entries.show.edit'), edit_catalog_deployable_path((a)catalog_entry.catalog, @catalog_entry), :class => 'button', :id => 'edit_button'
+ = button_to t('catalog_entries.show.delete'), catalog_deployable_path(@catalog, @deployable), :method => 'delete', :confirm => "#{t'catalog_entries.show.confirm_delete'}", :class => 'button danger', :id => 'delete'
+ = link_to t('catalog_entries.show.edit'), edit_catalog_deployable_path(@catalog, @deployable), :class => 'button', :id => 'edit_button'
- = link_to t('deployments.overview.launch'), launch_new_deployments_path(:deployable_id => @catalog_entry.deployable.id, :pool_id => @catalog_entry.catalog.pool), :id => :launch_deployment
+ = link_to t('deployments.overview.launch'), launch_new_deployments_path(:deployable_id => @deployable.id, :pool_id => @catalog.pool), :id => :launch_deployment
%section.admin-content-section.deployable
%section.image
@@ -61,7 +61,7 @@
%p= t('.choose_catalog')
= form_for(:catalog_entry, :url => catalog_entries_path) do |f|
= f.select :catalog_id, options_for_select(@catalogs_options)
- = f.hidden_field(:deployable_id, :value => @catalog_entry.deployable.id)
+ = f.hidden_field(:deployable_id, :value => @deployable.id)
= f.submit t('catalog_entries.show.add_catalog'), :id => :add_catalog
%table
--
1.7.6.4
12 years, 4 months
End-of-sprint branching/repofreeze EOD Thursday
by steve linabery
Hi Aeolus Community,
Sometime toward the close of business GMT-0500 on Thursday, 1 Dec 2011, we will be creating git branches for Release Candidates on the packages that belong specifically to the aeolus project (i.e. conductor, configure, aeolus-cli, etc.)
Following the cutoff we will only cherry-pick patches over to the release with appropriate authorization from a team manager.
So please shepherd your commits onto master before COB on Thursday if you want 'em in the forthcoming aeolus 0.7.0 release.
Thank you!
Steve|eggs
12 years, 4 months
[PATCH aeolus-image-rubygem] Fixed creation of a bucket when saving a bucket object
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
https://www.aeolusproject.org/redmine/issues/2863
Before a template or image is saved into warehouse, check if the
bucket for the template/image exists, if not, create it.
---
.../model/warehouse/warehouse_model.rb | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/lib/aeolus_image/model/warehouse/warehouse_model.rb b/lib/aeolus_image/model/warehouse/warehouse_model.rb
index 6ec02fa..ab2498e 100644
--- a/lib/aeolus_image/model/warehouse/warehouse_model.rb
+++ b/lib/aeolus_image/model/warehouse/warehouse_model.rb
@@ -154,6 +154,17 @@ module Aeolus
def create!(key, body, attributes)
self.set_warehouse_and_bucket if self.bucket.nil?
+ unless self.warehouse.buckets.include?(self.bucket.name)
+ begin
+ self.bucket = self.warehouse.create_bucket(self.bucket.name)
+ rescue
+ # there was an iwhd bug ago - it wasn't possible to find out
+ # if a bucket exists or not, then code 500 was returned.
+ # I'm not sure if it's already fixed or not so I'm wrapping it
+ # with rescue block. If exception is raised we can assume
+ # that bucket already exists.
+ end
+ end
obj = self.bucket.create_object(key, body, attributes)
self.new(obj)
end
--
1.7.6.4
12 years, 4 months