[PATCH conductor] Fix images#show when there's no existing build
by Imre Farkas
From: Imre Farkas <ifarkas(a)redhat.com>
---
src/app/controllers/images_controller.rb | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/app/controllers/images_controller.rb b/src/app/controllers/images_controller.rb
index 8566191..a114f9d 100644
--- a/src/app/controllers/images_controller.rb
+++ b/src/app/controllers/images_controller.rb
@@ -380,7 +380,12 @@ class ImagesController < ApplicationController
end
active_build =
- @builder.find_active_build((a)build.id, provider_type.deltacloud_driver)
+ if @build
+ @builder.find_active_build((a)build.id, provider_type.deltacloud_driver)
+ else
+ @builder.find_active_build_by_imageid((a)image.id, provider_type.deltacloud_driver)
+ end
+
build_status = { :is_active_build => active_build.present?,
:build_action_available => !target_image.present? &&
(@is_latest_build || !@build),
@@ -405,9 +410,11 @@ class ImagesController < ApplicationController
:target => provider_type.deltacloud_driver,
:build_id => @build ? @build.id : nil)
failed_build_count =
- @builder.failed_build_count((a)build.id, provider_type.deltacloud_driver)
+ if @build
+ @builder.failed_build_count((a)build.id, provider_type.deltacloud_driver)
+ end
- if failed_build_count > 0
+ if failed_build_count.present? && failed_build_count > 0
build_status[:translated_failed_build_count] =
t('images.show.failed_build_attempts', :count => failed_build_count)
end
--
1.7.6.5
11 years, 10 months
[PATCH conductor] BZ808338: fix ajax caching for IE
by Imre Farkas
This issue was really hard to debug: first, I was able to reproduce it only in production environment, not in development env. It's still unclear how it affects Internet Explorer's behaviour.
As it turned out, IE caches every ajax requests. It means that e.g. on the deployments#show page clicking on the Properties tab, then the Instances tab and then back to the Properties tab does not fire any request to the server to update the content of the Properties tab. Needless to say that it's not broken in FF or Chrome.
The solution is quite simple, jQuery provides a 'cache' parameter for the global ajaxSetup config. If it's false, then jQuery will append a timestamp to the url avoiding the IE browser cache.
11 years, 10 months
aeolus security - round 2 (rev 1)
by Mo Morsi
This patchset contains the remaining patches from the first round
rebased against the current head with the whitespace errors removed.
Additionally it incorporates more fixes from the list of tasks
from the controller audit.
Scott's feedback to the original patchset has been incorporated
into this revision.
11 years, 10 months
Aeolus 0.9.0 rpms now in our repo
by Justin Clift
Hey all,
Just created a set of Aeolus 0.9.0 rpms, for F16/F17 and RHEL/CentOS 6.2
(64-bit only), and put them in a new 0.9.0 repo on our site.
http://repos.fedorapeople.org/repos/aeolus/conductor/0.9.0/
The Conductor rpms for this release are from the 0.9-maint branch in
GitHub:
https://github.com/aeolusproject/conductor/tree/0.9-maint
Everything else is from our testing repo. *Seems ok* in my limited
testing on F15, F16, and RHEL6.
(configure works, EC2 deployment goes ok, that kind of thing)
Also updated our "latest-release" repository link, so anyone using
the "Stable" installation instructions now gets 0.9.0.
If anyone has questions, feel free to ask. :)
Regards and best wishes,
Justin Clift
--
Aeolus Community Manager
http://www.aeolusproject.org
11 years, 10 months
cloud state requirements
by Jan Provazník
Hi,
Deltacloud is going to implement a stateful app on top of DC API. This
app will do very similar job to what we planned with Cloud State. Some
basic ideas/thoughts about Cloud State are described on wiki:
https://www.aeolusproject.org/redmine/projects/aeolus/wiki/Cloud_State
So for us it would be much easier to use this deltacloud app instead of
implementing the same thing.
Here are some basic requirements which we would need on Conductor side
from the stateful app:
1) the app should check state of not only instances but also other
resources - we need especially realms because we check availability status
2) it should be possible to register hooks for a resource I want to
watch, hook could be just an URL, when the resource is changed data are
POSTed to the registered URL.
TODO: authentication when posting data to hook url? we use oauth between
other components now
TODO: how to handle hook failures (conductor is not accessible and hook
can't be invoked)?
TODO: how to handle credentials? will the stateful app keep credentails
permanently for each instance being checked?
3) frequency of instance status checking: we probably don't need to have
this configurable, but the checking frequency should be as low as
possible - various actions are hooked to instance state changes (for
example runtime is measured by this). It should be also scalable - if
there are 100 instances for one provider account, we still need check
all of them. Would be nice to use multiple parallel requests to provider
if possible or checking interval might be dynamically increased
according to the actual length of queue).
Jan
11 years, 10 months
[PATCH conductor] bug 808031: allow Global Provider user to view Provider Accounts
by Scott Seago
https://bugzilla.redhat.com/show_bug.cgi?id=808031
For provider accounts, the 'edit' action doubles as the 'show' page.
This meant we were requiring modify privileges on the provider to even
see the provider pages. This patch relaxes the checking to reqiure
only view permissions, and in the views we hide the edit/modify actions
from users that don't have the higher privileges, and the form elements
are made read-only.
---
.../controllers/provider_accounts_controller.rb | 1 +
src/app/controllers/providers_controller.rb | 4 +++-
src/app/views/provider_accounts/_list.html.haml | 3 ++-
src/app/views/providers/_edit.html.haml | 12 +++++++-----
src/app/views/providers/_form.html.haml | 8 ++++----
src/app/views/providers/new.html.haml | 2 +-
6 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/src/app/controllers/provider_accounts_controller.rb b/src/app/controllers/provider_accounts_controller.rb
index bf48af3..4aeee9c 100644
--- a/src/app/controllers/provider_accounts_controller.rb
+++ b/src/app/controllers/provider_accounts_controller.rb
@@ -69,6 +69,7 @@ class ProviderAccountsController < ApplicationController
else
@provider = Provider.find(params[:provider_id])
end
+ require_privilege(Privilege::CREATE, ProviderAccount, @provider)
end
def create
diff --git a/src/app/controllers/providers_controller.rb b/src/app/controllers/providers_controller.rb
index 64a334f..e96ec34 100644
--- a/src/app/controllers/providers_controller.rb
+++ b/src/app/controllers/providers_controller.rb
@@ -55,7 +55,9 @@ class ProvidersController < ApplicationController
@provider = Provider.find_by_id(params[:id])
@title = t 'cloud_providers'
session[:current_provider_id] = @provider.id
- require_privilege(Privilege::MODIFY, @provider)
+ # requiring VIEW rather than MODIFY since edit doubles as the 'show' page
+ # here -- actions must be hidden explicitly in template
+ require_privilege(Privilege::VIEW, @provider)
@alerts = provider_alerts(@provider)
diff --git a/src/app/views/provider_accounts/_list.html.haml b/src/app/views/provider_accounts/_list.html.haml
index 60e217d..31f73c7 100644
--- a/src/app/views/provider_accounts/_list.html.haml
+++ b/src/app/views/provider_accounts/_list.html.haml
@@ -1,7 +1,8 @@
.content
- content_for :form_header do
%li= restful_submit_tag t('delete'), "destroy", multi_destroy_provider_provider_accounts_path(@provider), 'DELETE', :id => 'delete_button', :class => 'button danger'
- %li= link_to t('provider_accounts.new_provider_account'), new_provider_provider_account_path(@provider), :id => 'new_provider_account', :class => 'button'
+ - if check_privilege(Privilege::CREATE, ProviderAccount, @provider)
+ %li= link_to t('provider_accounts.new_provider_account'), new_provider_provider_account_path(@provider), :id => 'new_provider_account', :class => 'button'
- content_for :filter_controls do
%li
diff --git a/src/app/views/providers/_edit.html.haml b/src/app/views/providers/_edit.html.haml
index 8ba45fd..22ab0db 100644
--- a/src/app/views/providers/_edit.html.haml
+++ b/src/app/views/providers/_edit.html.haml
@@ -1,8 +1,10 @@
.content
= form_for @provider, :url => provider_path(@provider), :html => { :method => :put, :class => 'generic horizontal' } do |f|
- = render :partial => 'form', :locals => { :form => f }
+ - can_edit = check_privilege(Privilege::MODIFY, @provider)
+ = render :partial => 'form', :locals => { :form => f, :readonly => !can_edit }
%fieldset.options
- .button-group
- = f.submit "Save Changes", :class => "submit button pill", :id => 'save'
- = link_to "Test Connection", edit_provider_path(@provider, :test_provider => true), :class => 'button pill'
- = link_to 'Delete Provider', provider_path(@provider), :method => :delete, :confirm => t('providers.confirm_delete'), :class => "button pill danger", :id => "delete"
+ - if can_edit
+ .button-group
+ = f.submit "Save Changes", :class => "submit button pill", :id => 'save'
+ = link_to "Test Connection", edit_provider_path(@provider, :test_provider => true), :class => 'button pill'
+ = link_to 'Delete Provider', provider_path(@provider), :method => :delete, :confirm => t('providers.confirm_delete'), :class => "button pill danger", :id => "delete"
diff --git a/src/app/views/providers/_form.html.haml b/src/app/views/providers/_form.html.haml
index 387d952..480e31b 100644
--- a/src/app/views/providers/_form.html.haml
+++ b/src/app/views/providers/_form.html.haml
@@ -4,19 +4,19 @@
.field
= form.label :name, :class => 'em'
.input
- = form.text_field :name, :value => @provider.name, :class => 'em long'
+ = form.text_field :name, :value => @provider.name, :class => 'em long', :readonly => readonly
.field
= form.label :url
.input
- = form.text_field :url, :value => @provider.url, :class => 'long'
+ = form.text_field :url, :value => @provider.url, :class => 'long', :readonly => readonly
.field
= form.label :provider_type_id
.input
- = form.select(:provider_type_id, @provider_type_options, :prompt => t('providers.form.select_type_of_provider'))
+ = form.select(:provider_type_id, @provider_type_options, {:prompt => t('providers.form.select_type_of_provider')}, {:disabled => readonly})
.field
= form.label :deltacloud_provider, t('providers.form.x_deltacloud_provider.generic')
.input
- = form.text_field :deltacloud_provider, :title => t('providers.form.x_deltacloud_provider.generic'), :value => @provider.deltacloud_provider
+ = form.text_field :deltacloud_provider, :title => t('providers.form.x_deltacloud_provider.generic'), :value => @provider.deltacloud_provider, :readonly => readonly
.field#x-deltacloud-provider-legend
%label= t('providers.form.x_deltacloud_provider_legend')
.input
diff --git a/src/app/views/providers/new.html.haml b/src/app/views/providers/new.html.haml
index bcac552..b2465b1 100644
--- a/src/app/views/providers/new.html.haml
+++ b/src/app/views/providers/new.html.haml
@@ -16,6 +16,6 @@
%h2.settings= t("settings.settings")
.content
= form_for @provider, :url => providers_path, :html => {:class => 'generic horizontal'} do |f|
- = render :partial => "form", :locals => { :form => f, :cancel_path => providers_path }
+ = render :partial => "form", :locals => { :form => f, :cancel_path => providers_path, :readonly => false }
%fieldset.options
= f.submit t("providers.new.save_provider"), :class => "submit button pill", :id => 'save'
--
1.7.6.5
11 years, 10 months