[PATCH configure] BZ#766661 - more ec2 provider errors with aeolus-configure
by John Eckersberg
https://bugzilla.redhat.com/show_bug.cgi?id=766661
Exec[deltacloud-core-startup-wait] naively sleeps for one second in
order to allow deltacloud-core to completely start up. However in
observation sometimes deltacloud-core can take upwards of 20 seconds
to start. This patch modifies the exec to instead poll to ensure
deltacloud-core is listening on localhost:3002.
---
recipes/aeolus/manifests/deltacloud.pp | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/recipes/aeolus/manifests/deltacloud.pp b/recipes/aeolus/manifests/deltacloud.pp
index cb442d1..08cd671 100644
--- a/recipes/aeolus/manifests/deltacloud.pp
+++ b/recipes/aeolus/manifests/deltacloud.pp
@@ -34,11 +34,12 @@ class aeolus::deltacloud::core {
hasstatus => true,
require => [Package['deltacloud-core'], File["/var/log/deltacloud-core"]]}
- # Need to pause for a second for deltacloud-core to complete startup
+ # Need to poll for deltacloud-core to complete startup
# otherwise one may see connect issues when adding providers
exec{"deltacloud-core-startup-wait":
- cwd => '/bin',
- command => "/bin/sleep 1",
+ command => "/usr/bin/nc -z localhost 3002",
+ tries => 60,
+ try_sleep => 1,
require => Service["deltacloud-core"]}
}
--
1.7.7.5
12 years, 3 months
[PATCH conductor] Checking for blank fields on images#import
by Imre Farkas
From: Imre Farkas <ifarkas(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=770903
---
src/app/controllers/images_controller.rb | 6 ++++++
src/config/locales/en.yml | 3 +++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/app/controllers/images_controller.rb b/src/app/controllers/images_controller.rb
index 018929c..f5a0791 100644
--- a/src/app/controllers/images_controller.rb
+++ b/src/app/controllers/images_controller.rb
@@ -92,6 +92,12 @@ class ImagesController < ApplicationController
end
def import
+ if params[:image_id].blank? || params[:name].blank?
+ flash[:warning] = t('images.import.flash.warning.name_or_image_id_blank')
+ redirect_to new_image_url(:tab => 'import')
+ return
+ end
+
account = ProviderAccount.find(params[:provider_account])
xml = "<image><name>#{params[:name]}</name></image>" unless params[:name].blank?
begin
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 4be4510..7e149d3 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -691,6 +691,9 @@ en:
name: Image Name
image_imported: The image was imported successfully.
image_not_imported: The image could not be imported. Check the Image Factory log for further details.
+ flash:
+ warning:
+ name_or_image_id_blank: 'Image ID and Image Name cannot be blank!'
index:
images: Images
name: Name
--
1.7.6.4
12 years, 3 months
[PATCH conductor 0/1] BZ 771505 - dbomatic fails to start
by Matt Wagner
Mea culpa on this. It appears that a subtle and seemingly-fine change of mine a while back broke dbomatic.
Within a couple controllers where we needed it, I was able to do "require 'lib/image'" which appeared to look in the correct place (Rails root) and include lib/image.rb. Conductor worked fine, so life was peachy, I got an ACK, and committed the code last month.
It seems that, for reasons I can't quite figure out, dbomatic chokes on this: it is unable to find the file when I reference it this way and thus fails to start. Feeling like I was swimming against the tide, I just fixed this by moving the reference into application.rb and referencing it by a full path. (Though I wonder if we should be using Rails.root, but it works fine as-is, so I don't want to change it now.)
-- Matt
12 years, 3 months
[PATCH conductor] Rename Catalog Entries to Deployables in the UI
by Imre Farkas
From: Tomas Sedovic <tomas(a)sedovic.cz>
https://bugzilla.redhat.com/show_bug.cgi?id=760661
---
src/config/locales/en.yml | 30 +++++++++++++++---------------
src/features/deployables.feature | 10 +++++-----
2 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 80bd35b..4be4510 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -189,7 +189,7 @@ en:
launch_from_catalog:
profile: Profile
hint: Choose a deployable to launch in the "%{pool}" pool
- no_catalog_entry: 'No available catalog entry. Please add one first!'
+ no_catalog_entry: 'No available deployable. Please add one first!'
details: Details
select: Select
image_id: Image ID
@@ -415,7 +415,7 @@ en:
destroy: Destroy
images:
catalog: Catalog
- catalog_entry: Catalog Entry
+ catalog_entry: Deployable
image: "Image:"
pushed: %{uuid} pushed to %{provider}
properties:
@@ -607,14 +607,14 @@ en:
select_to_add_accounts: "You must select at least one Provider Account to add."
select_to_remove_accounts: "You must select at least one Provider Account to remove."
catalog_entries:
- new_catalog_entry: New Catalog Entry
+ new_catalog_entry: New Deployable
index:
- catalog_entry: Catalog Entry
- catalog_entries: Catalog Entries
+ catalog_entry: Deployable
+ catalog_entries: Deployables
name: Name
deployable_xml: Deployable XML
new:
- add_catalog_entry: Add New Catalog Entry
+ add_catalog_entry: Add New Deployable
choose_option_to_upload: Choose one of the following options to upload deployable XML file
upload: Upload
from_url: From URL
@@ -633,21 +633,21 @@ en:
rebuild_all: Rebuild all images
start: Start
edit:
- editing_catalog_entry: Editing Catalog Entry
+ editing_catalog_entry: Editing Deployable
list:
- catalog_entries_list: Catalog Entries List
+ catalog_entries_list: Deployables List
flash:
warning:
- not_valid_or_reachable: "Catalog entry XML file is either invalid or no longer reachable at %{url}"
- no_url_provided: "No URL provided for the catalog entry XML file."
+ not_valid_or_reachable: "Deployable XML file is either invalid or no longer reachable at %{url}"
+ no_url_provided: "No URL provided for the deployable XML file."
not_valid: "Deployable XML file doesn't resolve valid XML"
- failed: Catalog entry was not created.
+ failed: Deployable was not created.
notice:
- added: Catalog entry added.
- updated: Catalog entry updated successfully!
- deleted: Catalog entry deleted.
+ added: Deployable added.
+ updated: Deployable updated successfully!
+ deleted: Deployable deleted.
preset_filters:
- all_catalog_entries: All Catalog Entries
+ all_catalog_entries: All Deployables
catalogs:
catalogs: Catalogs
new_catalog: New Catalog
diff --git a/src/features/deployables.feature b/src/features/deployables.feature
index 16c7020..9a60274 100644
--- a/src/features/deployables.feature
+++ b/src/features/deployables.feature
@@ -10,14 +10,14 @@ Feature: Manage Catalog Entries
Scenario: Create new catalog entry
Given there is a "default" catalog
When I am on the "default" catalog catalog entries page
- Then I should see "Catalog Entries"
+ Then I should see "Deployables"
When I follow "new_catalog_entry_button"
- Then I should see "Add New Catalog Entry"
+ Then I should see "Add New Deployable"
When I fill in "deployable[name]" with "test1"
And I fill in "deployable[description]" with "description"
When I attach the file "features/upload_files/deployable.xml" to "deployable[xml]"
And I press "save_button"
- Then I should see "Catalog entry added"
+ Then I should see "Deployable added"
Scenario: Change the name
Given there is a "default" catalog
@@ -25,10 +25,10 @@ Feature: Manage Catalog Entries
When I am on the "default" catalog catalog entries page
When I follow "testdepl"
And I follow "edit_button"
- Then I should see "Editing Catalog Entry"
+ Then I should see "Editing Deployable"
When I fill in "deployable[name]" with "testdepl-renamed"
And I press "save_button"
- Then I should see "Catalog entry updated successfully!"
+ Then I should see "Deployable updated successfully!"
And I should see "testdepl-renamed"
Scenario: Show catalog entry details
--
1.7.6.4
12 years, 3 months
[PATCH conductor 0/2] #765703 - Proper error for blank image on import
by Matt Wagner
It was requested that we display a better error than the default error when attempting to import an image through the web UI without actually inputting any data. This patch adds explicit validation for this case. (Note that without this patch, an error is still raised, but it's a generic error indicating that the image could not be imported. This patch clarifies the error message.)
The first patch, adding a missing class name to the form, is not strictly related, but it's an extremely minor change that makes the form look considerably less-ugly and brings it inline with how forms are supposed to be styled, so I'm including it while I was there.
-- Matt
12 years, 3 months
[PATCH conductor] update pools count with applying filters in pools table (bz770620)
by Jirka Tomasek
From: Jiri Tomasek <jtomasek(a)redhat.com>
---
src/app/views/pools/_list.html.haml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/app/views/pools/_list.html.haml b/src/app/views/pools/_list.html.haml
index 32126f7..6022d44 100644
--- a/src/app/views/pools/_list.html.haml
+++ b/src/app/views/pools/_list.html.haml
@@ -8,7 +8,7 @@
= select_tag(:pools_preset_filter, preset_filters_options_for_select(Pool::PRESET_FILTERS_OPTIONS, params[:pools_preset_filter]), :include_blank => t("pools.preset_filters.all_pools"))
= hidden_field_tag :current_path, request.fullpath
= restful_submit_tag t("filter_table.apply_filters"), "filter", filter_pools_path, 'POST', :class => 'button', :id => 'apply_pools_preset_filter'
- %span.label.badge.dark= @user_pools.count
+ %span.label.badge.dark= @pools.count
%li.table-search-filter
= text_field_tag :pools_search, params[:pools_search], :placeholder => t("filter_table.search")
= restful_submit_tag "", "search", filter_pools_path, 'POST', :class => 'button', :id => 'apply_pools_search', :name => "apply_search"
--
1.7.7.4
12 years, 3 months
[PATCH conductor] Rename Catalog Entries to Deployables in the UI
by Tomas Sedovic
From: Tomas Sedovic <tomas(a)sedovic.cz>
https://bugzilla.redhat.com/show_bug.cgi?id=760661
---
src/config/locales/en.yml | 30 +++++++++++++++---------------
src/features/deployables.feature | 10 +++++-----
2 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 51cbc8f..cfd2f1f 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -184,7 +184,7 @@ en:
launch_from_catalog:
profile: Profile
hint: Choose a deployable to launch in the "%{pool}" pool
- no_catalog_entry: 'No available catalog entry. Please add one first!'
+ no_catalog_entry: 'No available deployable. Please add one first!'
details: Details
select: Select
image_id: Image ID
@@ -408,7 +408,7 @@ en:
destroy: Destroy
images:
catalog: Catalog
- catalog_entry: Catalog Entry
+ catalog_entry: Deployable
image: "Image:"
pushed: %{uuid} pushed to %{provider}
properties:
@@ -600,14 +600,14 @@ en:
select_to_add_accounts: "You must select at least one Provider Account to add."
select_to_remove_accounts: "You must select at least one Provider Account to remove."
catalog_entries:
- new_catalog_entry: New Catalog Entry
+ new_catalog_entry: New Deployable
index:
- catalog_entry: Catalog Entry
- catalog_entries: Catalog Entries
+ catalog_entry: Deployable
+ catalog_entries: Deployables
name: Name
deployable_xml: Deployable XML
new:
- add_catalog_entry: Add New Catalog Entry
+ add_catalog_entry: Add New Deployable
choose_option_to_upload: Choose one of the following options to upload deployable XML file
upload: Upload
from_url: From URL
@@ -626,21 +626,21 @@ en:
rebuild_all: Rebuild all images
start: Start
edit:
- editing_catalog_entry: Editing Catalog Entry
+ editing_catalog_entry: Editing Deployable
list:
- catalog_entries_list: Catalog Entries List
+ catalog_entries_list: Deployables List
flash:
warning:
- not_valid_or_reachable: "Catalog entry XML file is either invalid or no longer reachable at %{url}"
- no_url_provided: "No URL provided for the catalog entry XML file."
+ not_valid_or_reachable: "Deployable XML file is either invalid or no longer reachable at %{url}"
+ no_url_provided: "No URL provided for the deployable XML file."
not_valid: "Deployable XML file doesn't resolve valid XML"
- failed: Catalog entry was not created.
+ failed: Deployable was not created.
notice:
- added: Catalog entry added.
- updated: Catalog entry updated successfully!
- deleted: Catalog entry deleted.
+ added: Deployable added.
+ updated: Deployable updated successfully!
+ deleted: Deployable deleted.
preset_filters:
- all_catalog_entries: All Catalog Entries
+ all_catalog_entries: All Deployables
catalogs:
catalogs: Catalogs
new_catalog: New Catalog
diff --git a/src/features/deployables.feature b/src/features/deployables.feature
index 16c7020..9a60274 100644
--- a/src/features/deployables.feature
+++ b/src/features/deployables.feature
@@ -10,14 +10,14 @@ Feature: Manage Catalog Entries
Scenario: Create new catalog entry
Given there is a "default" catalog
When I am on the "default" catalog catalog entries page
- Then I should see "Catalog Entries"
+ Then I should see "Deployables"
When I follow "new_catalog_entry_button"
- Then I should see "Add New Catalog Entry"
+ Then I should see "Add New Deployable"
When I fill in "deployable[name]" with "test1"
And I fill in "deployable[description]" with "description"
When I attach the file "features/upload_files/deployable.xml" to "deployable[xml]"
And I press "save_button"
- Then I should see "Catalog entry added"
+ Then I should see "Deployable added"
Scenario: Change the name
Given there is a "default" catalog
@@ -25,10 +25,10 @@ Feature: Manage Catalog Entries
When I am on the "default" catalog catalog entries page
When I follow "testdepl"
And I follow "edit_button"
- Then I should see "Editing Catalog Entry"
+ Then I should see "Editing Deployable"
When I fill in "deployable[name]" with "testdepl-renamed"
And I press "save_button"
- Then I should see "Catalog entry updated successfully!"
+ Then I should see "Deployable updated successfully!"
And I should see "testdepl-renamed"
Scenario: Show catalog entry details
--
1.7.6.4
12 years, 3 months
[PATCH conductor] Autoupdating pretty view fixed on Pools#index for multiline array of deployments
by Imre Farkas
From: Imre Farkas <ifarkas(a)redhat.com>
---
src/app/views/pools/_deployments.html.haml | 33 ++++++++++++++-------------
src/public/javascripts/backbone/views.js | 15 ++++++++++--
2 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/src/app/views/pools/_deployments.html.haml b/src/app/views/pools/_deployments.html.haml
index af0b8b8..60b7fc6 100644
--- a/src/app/views/pools/_deployments.html.haml
+++ b/src/app/views/pools/_deployments.html.haml
@@ -1,20 +1,21 @@
-- deployments.in_groups_of(5, false) do |group|
- %ul.deployment-array.small
- - group.each do |deployment|
- %li.deployment
- %h3.name
- = link_to deployment.name, deployment_path(deployment)
- = t 'pools.index.global_uptime'
- = count_uptime(deployment.uptime_all)
- %dl.statistics
- %ul
- %li.right
- %dt.instances.count= t 'instances.instances'
- %dd= deployment.instances.count || 0
+#deployment-arrays
+ - deployments.in_groups_of(5, false) do |group|
+ %ul.deployment-array.small
+ - group.each do |deployment|
+ %li.deployment
+ %h3.name
+ = link_to deployment.name, deployment_path(deployment)
+ = t 'pools.index.global_uptime'
+ = count_uptime(deployment.uptime_all)
+ %dl.statistics
+ %ul
+ %li.right
+ %dt.instances.count= t 'instances.instances'
+ %dd= deployment.instances.count || 0
- %li.left
- %dt=t :uptime
- %dd= count_uptime(deployment.uptime_1st_instance)
+ %li.left
+ %dt=t :uptime
+ %dd= count_uptime(deployment.uptime_1st_instance)
%script#deploymentPrettyTemplate{ :type => 'text/x-jquery-tmpl' }
:plain
diff --git a/src/public/javascripts/backbone/views.js b/src/public/javascripts/backbone/views.js
index f6076e1..680ca9d 100644
--- a/src/public/javascripts/backbone/views.js
+++ b/src/public/javascripts/backbone/views.js
@@ -51,9 +51,18 @@ Conductor.Views.PoolsIndex = Backbone.View.extend({
$table.find('tr:odd').addClass('stripe');
}
else if (this.currentView() == 'pretty') {
- $deployments = this.$('ul.deployment-array');
- var $template = this.template();
- $deployments.empty().append($template.tmpl(this.collection.toJSON()))
+ var $rows = this.$('#deployment-arrays').empty();
+ var cardsPerRow = 5;
+ var deployments = this.collection.models.map(function(model) {
+ return model.attributes;
+ });
+
+ for(var i = 0; i < deployments.length; i += cardsPerRow) {
+ var $row = this.make('ul',
+ {class: 'deployment-array small'},
+ $template.tmpl(deployments.slice(i, i + cardsPerRow)));
+ $rows.append($row);
+ }
}
},
});
--
1.7.6.4
12 years, 3 months
[PATCH conductor] Fixing failing rspec tests
by Imre Farkas
From: Imre Farkas <ifarkas(a)redhat.com>
In the last test case of deployable_spec the xml is modified on the Deployable object and somehow (probably a factory_girl bug) the modified xml attribute is cached in the deployable factory. In catalog_entry_spec the modified deployable factory caused the failures.
---
src/spec/models/deployable_spec.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/spec/models/deployable_spec.rb b/src/spec/models/deployable_spec.rb
index cf4bb1d..7e91ae2 100644
--- a/src/spec/models/deployable_spec.rb
+++ b/src/spec/models/deployable_spec.rb
@@ -34,7 +34,7 @@ describe Deployable do
it "should not be valid if xml is not parsable" do
deployable = FactoryGirl.build(:deployable)
deployable.should be_valid
- deployable.xml << "</deployable>"
+ deployable.xml = deployable.xml.clone << "</deployable>"
deployable.should_not be_valid
end
--
1.7.6.4
12 years, 3 months