Deployment launch
by Jan Provazník
Hi, this patch adds very simple UI for launching a deployment from a deployable
show page (tabs deployment).
13 years
[PATCH aeolus] Do not alter selinux rules when selinux is disabled
by Angus Thomas
From: Angus Thomas <athomas(a)redhat.com>
---
recipes/apache/manifests/init.pp | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/recipes/apache/manifests/init.pp b/recipes/apache/manifests/init.pp
index 79f15f9..dbecbf8 100644
--- a/recipes/apache/manifests/init.pp
+++ b/recipes/apache/manifests/init.pp
@@ -12,7 +12,9 @@ class apache {
# if selinux is enabled and we want to use mod_proxy, we need todo this
exec{'permit-http-networking':
command => '/usr/sbin/setsebool httpd_can_network_connect 1',
- logoutput => true }
+ logoutput => true,
+ unless => "/usr/bin/test 'Disabled' = `/usr/sbin/getenforce`"
+ }
service { "httpd":
ensure => running,
--
1.7.4.4
13 years
Pool family quota (rev. 3)
by Jan Provazník
This patchset associates quota with pool family. To be fully functional, condor
plugin has to be updated to check pool family when starting instance.
13 years
[PATCH] Create UI for associating provider accounts with pool family
by Jirka Tomasek
From: Jiri Tomasek <jtomasek(a)redhat.com>
---
.../controllers/admin/pool_families_controller.rb | 29 ++++++++++++++++++-
src/app/views/admin/pool_families/_list.haml | 2 +-
.../admin/pool_families/_provider_accounts.haml | 25 +++++++++++++++++
src/config/routes.rb | 2 +-
src/features/pool_family.feature | 22 +++++++++++++++
src/features/step_definitions/pool_family_steps.rb | 23 +++++++++++++++-
src/features/support/paths.rb | 3 ++
7 files changed, 101 insertions(+), 5 deletions(-)
diff --git a/src/app/controllers/admin/pool_families_controller.rb b/src/app/controllers/admin/pool_families_controller.rb
index af53aac..ec21c53 100644
--- a/src/app/controllers/admin/pool_families_controller.rb
+++ b/src/app/controllers/admin/pool_families_controller.rb
@@ -2,6 +2,7 @@ class Admin::PoolFamiliesController < ApplicationController
before_filter :require_user
before_filter :set_params_and_header, :only => [:index, :show]
before_filter :load_pool_families, :only =>[:show]
+ before_filter :load_tab_captions_and_details_tab, :only => [:show]
def index
@search_term = params[:q]
@@ -50,8 +51,7 @@ class Admin::PoolFamiliesController < ApplicationController
def show
@pool_family = PoolFamily.find(params[:id])
@url_params = params.clone
- @tab_captions = ['Properties', 'History', 'Permissions', 'Provider Accounts', 'Pools']
- @details_tab = params[:details_tab].blank? ? 'properties' : params[:details_tab]
+
respond_to do |format|
format.js do
if @url_params.delete :details_pane
@@ -63,6 +63,15 @@ class Admin::PoolFamiliesController < ApplicationController
end
end
+ def add_provider_account
+ @pool_family = PoolFamily.find(params[:id])
+ @provider_account = ProviderAccount.find(params[:provider_account_id])
+
+ @pool_family.provider_accounts << @provider_account
+ flash[:notice] = "Provider Account has been added"
+ redirect_to admin_pool_family_path(@pool_family, :details_tab => 'provider_accounts')
+ end
+
def multi_destroy
deleted = []
not_deleted = []
@@ -82,8 +91,24 @@ class Admin::PoolFamiliesController < ApplicationController
redirect_to admin_pool_families_path
end
+ def multi_destroy_provider_accounts
+ @pool_family = PoolFamily.find(params[:pool_family_id])
+
+ ProviderAccount.find(params[:provider_account_selected]).each do |provider_account|
+ @pool_family.provider_accounts.delete provider_account
+ end
+
+ redirect_to admin_pool_family_path(@pool_family, :details_tab => 'provider_accounts')
+ end
+
protected
+ def load_tab_captions_and_details_tab
+ @tab_captions = ['Properties', 'History', 'Permissions', 'Provider Accounts', 'Pools']
+ @details_tab = params[:details_tab].blank? ? 'properties' : params[:details_tab]
+ @provider_accounts_header = [{ :name => "Provider Account", :sort_attr => :name}]
+ end
+
def set_params_and_header
@url_params = params.clone
@header = [{ :name => "Name", :sort_attr => :name},
diff --git a/src/app/views/admin/pool_families/_list.haml b/src/app/views/admin/pool_families/_list.haml
index a824676..6250c66 100644
--- a/src/app/views/admin/pool_families/_list.haml
+++ b/src/app/views/admin/pool_families/_list.haml
@@ -8,7 +8,7 @@
%span> ,
= link_to "None", @url_params.merge(:select => 'none')
- %table#pool_famlies_table
+ %table#pool_families_table
= sortable_table_header @header
- unless @pool_families.blank?
- @pool_families.each do |pool_family|
diff --git a/src/app/views/admin/pool_families/_provider_accounts.haml b/src/app/views/admin/pool_families/_provider_accounts.haml
index e69de29..358e3d2 100644
--- a/src/app/views/admin/pool_families/_provider_accounts.haml
+++ b/src/app/views/admin/pool_families/_provider_accounts.haml
@@ -0,0 +1,25 @@
+%h3
+ Provider Accounts for
+ = @pool_family.name
+
+- unless @pool_family.provider_accounts.blank?
+ - form_tag do
+ = restful_submit_tag "Remove selected", 'destroy', multi_destroy_provider_accounts_admin_pool_families_path(:pool_family_id => @pool_family.id), 'DELETE', :id => 'delete_button'
+ = #submit_tag "Remove selected"
+
+ %table#provider_accounts_table
+ = sortable_table_header @provider_accounts_header
+ - @pool_family.provider_accounts.each do |provider_account|
+ %tr
+ %td
+ - selected = @url_params[:select_provider_accounts] == 'all'
+ %input{:name => "provider_account_selected[]", :type => "checkbox", :value => provider_account.id, :id => "provider_account_checkbox_#{provider_account.id}", :checked => selected }
+ = provider_account.name
+
+- unless @pool_family.provider_accounts.count == ProviderAccount.all.count
+ - form_for :pool_family, :url => add_provider_account_admin_pool_families_path(:id => @pool_family.id) do |f|
+ - unless @pool_family.provider_accounts.blank?
+ = select_tag :provider_account_id, options_for_select(ProviderAccount.find(:all, :conditions => [ "id NOT IN (?)", @pool_family.provider_account_ids ]).collect{ |pa| [pa.name, pa.id] })
+ - else
+ = select_tag :provider_account_id, options_for_select(ProviderAccount.all.collect{ |pa| [pa.name, pa.id] })
+ = f.submit "Add to #{(a)pool_family.name}"
diff --git a/src/config/routes.rb b/src/config/routes.rb
index 162260c..6aa9c8c 100644
--- a/src/config/routes.rb
+++ b/src/config/routes.rb
@@ -58,7 +58,7 @@ ActionController::Routing::Routes.draw do |map|
r.resources :roles, :collection => { :multi_destroy => :delete }
r.resources :settings, :collection => { :self_service => :get, :general_settings => :get }
- r.resources :pool_families, :collection => { :multi_destroy => :delete }
+ r.resources :pool_families, :collection => { :multi_destroy => :delete, :add_provider_account => :post, :multi_destroy_provider_accounts => :delete }
r.resources :realms, :collection => { :multi_destroy => :delete }
r.resources :realm_mappings, :collection => { :multi_destroy => :delete }
end
diff --git a/src/features/pool_family.feature b/src/features/pool_family.feature
index 6795d42..fd4eb55 100644
--- a/src/features/pool_family.feature
+++ b/src/features/pool_family.feature
@@ -78,3 +78,25 @@ Feature: Pool Families
Then I should see "first_family"
And I should see "second_family"
And I should see "third_family"
+
+ Scenario: Add provider account to pool family
+ Given there is a pool family named "testpoolfamily"
+ And there is a provider named "testprovider"
+ And there is a provider account named "testaccount"
+ And I am on the pool family provider accounts page
+ Then I should see "Provider Accounts for"
+ When I select "testaccount" from "provider_account_id"
+ And I press "pool_family_submit"
+ Then there should be 1 provider accounts assigned to "testpoolfamily"
+ And I should see "testaccount"
+
+ Scenario: Remove provider account from pool family
+ Given there is a pool family named "testpoolfamily"
+ And there is a provider named "testprovider"
+ And there is a provider account named "testaccount"
+ And there is a provider account "testaccount" related to pool family "testpoolfamily"
+ And I am on the pool family provider accounts page
+ Then I should see "testaccount"
+ When I check "testaccount" provider account
+ And I press "Remove selected"
+ Then there should not exist a provider account assigned to "testpoolfamily"
diff --git a/src/features/step_definitions/pool_family_steps.rb b/src/features/step_definitions/pool_family_steps.rb
index 9585a21..716d722 100644
--- a/src/features/step_definitions/pool_family_steps.rb
+++ b/src/features/step_definitions/pool_family_steps.rb
@@ -5,7 +5,7 @@ Given /^there are these pool families:$/ do |table|
end
Given /^there is a pool family named "([^\"]*)"$/ do |name|
- @provider = Factory(:pool_family, :name => name)
+ @pool_family = Factory(:pool_family, :name => name)
end
Given /^there is not a pool family named "([^"]*)"$/ do |name|
@@ -25,3 +25,24 @@ end
Then /^there should not exist a pool family named "([^\"]*)"$/ do |name|
PoolFamily.find_by_name(name).should be_nil
end
+
+Then /^there should be (\d+) provider accounts assigned to "([^\"]*)"$/ do |count,name|
+ @pool_family = PoolFamily.find_by_name(name)
+ @pool_family.provider_accounts.count == count
+end
+
+Given /^there is a provider account "([^"]*)" related to pool family "([^"]*)"$/ do |provider_account, pool_family|
+ @pool_family = PoolFamily.find_by_name(pool_family)
+ @provider_account = ProviderAccount.find_by_label(provider_account)
+ @pool_family.provider_accounts << @provider_account
+end
+
+When /^I check "([^"]*)" provider account$/ do |label|
+ provider_account = ProviderAccount.find_by_label(label)
+ check("provider_account_checkbox_#{provider_account.id}")
+end
+
+Then /^there should not exist a provider account assigned to "([^"]*)"$/ do |name|
+ @pool_family = PoolFamily.find_by_name(name)
+ @pool_family.provider_accounts.count == 0
+end
diff --git a/src/features/support/paths.rb b/src/features/support/paths.rb
index 5af9b34..a313aa0 100644
--- a/src/features/support/paths.rb
+++ b/src/features/support/paths.rb
@@ -83,6 +83,9 @@ module NavigationHelpers
when /the template builds page/
url_for image_factory_template_path(@template, :details_tab => 'builds')
+ when /the pool family provider accounts page/
+ url_for admin_pool_family_path(@pool_family, :details_tab => 'provider_accounts')
+
when /the templates page/
templates_path
--
1.7.4.2
13 years
#1081 - Show Deployment owner, v2
by Matt Wagner
After talking with Scott, it sounds like we need to think through the
User permissions a bit more before implementing them here. Therefore, for
now, I'm sending a simplified version of my earlier patch, which merely
shows the deployment owner's name, but does not link to it.
This doesn't complete #1081 as written, but it will at least move us
forward until we sort out how we want to handle permissions linking to
other Users.
-- Matt
13 years
[PATCH conductor] add CondorCloud provider type
by Richard Su
add api key and secret as credential fields
---
...0110418120000_add_condor_cloud_provider_type.rb | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/db/migrate/20110418120000_add_condor_cloud_provider_type.rb b/src/db/migrate/20110418120000_add_condor_cloud_provider_type.rb
index 79503a8..8d8dab5 100644
--- a/src/db/migrate/20110418120000_add_condor_cloud_provider_type.rb
+++ b/src/db/migrate/20110418120000_add_condor_cloud_provider_type.rb
@@ -1,7 +1,10 @@
class AddCondorCloudProviderType < ActiveRecord::Migration
def self.up
- ProviderType.create!(:name => "CondorCloud", :build_supported => true, :codename =>"condorcloud")
+ provider_type = ProviderType.create!(:name => "CondorCloud", :build_supported => true, :codename =>"condorcloud")
+ CredentialDefinition.create!(:name => 'username', :label => 'API Key', :input_type => 'text', :provider_type_id => provider_type.id)
+ CredentialDefinition.create!(:name => 'password', :label => 'Secret', :input_type => 'password', :provider_type_id => provider_type.id)
+
end
def self.down
--
1.7.4.4
13 years
#1081 - Show Deployment owner
by Matt Wagner
Hi,
I'm attaching what probably should have been a simple patch to show the
username + a link for deployments. This also required making User a
PermissionedObject, as well as making the DeploymentsController actually
show Deployments in the first place. I didn't aim to fully finish the
Deployments page, since it was outside the scope of this task. (You will
note that none of the buttons up top work, for example.)
I found myself writing silly lines in views like:
= deployment.user.has_privilege(@current_user, Privilege::VIEW) ?
link_to(deployment.user.name, admin_user_path(deployment.user)) :
deployment.user.name
It also occurred to me that we're probably going to want to follow this
pattern (link to an object if the user has permission to see it; just
show its name or some other attribute in a table otherwise) elsewhere as
we move forward, so I elected to create a conditional_link helper
method.
Unfortunately, this required the ability to link_to an object without
knowing its path, e.g., link_to(User.first). This works ordinarily, but
because we use namespaces, it is not possible[1]. Since we don't
duplicate routes within namespaces (there is not an /admin/users and a
/resources/users), I wrote a fairly-ugly find_link_to(object) method to
try to determine the appropriate path in support of the above.
I'm sending these as three separate patches in case the above changes
are controversial. You'll need all three patches applied in order to test,
however.
-- Matt
[1]
http://stackoverflow.com/questions/731487/rails-correct-routing-for-names...
13 years
ANNOUNCE: libdeltacloud 0.8
by Chris Lalancette
All,
I'm pleased to announce the release of libdeltacloud version 0.8.
libdeltacloud is a library for accessing the Deltacloud API from C or C++
programs. There are several important changes in this release:
- The API for deltacloud_create_instance() has been changed, hopefully for the
last time. The previous version of the API had separate parameters for every
option we wanted to pass to the deltacloud server. This was confusing and
required that we break the API every time we wanted to add a new parameter.
The new version of the API expects an array of deltacloud_create_parameter
structures that describe the options to pass to the create call. This is
more intuitive, more flexible, and shouldn't require us to break the API again.
- We no longer expect return data from POST calls to the deltacloud API. The
deltacloud API does not guarantee any return data from a POST call (such as
that used to create new instances). libdeltacloud was erroneously assuming it
would get data back, which was causing problems with certain deltacloud
backends. The new version doesn't expect any return data from POST, and
instead requires the user of the library to make an additional GET call if
they want additional information about an instance.
- Other minor bugfixes
The release is available from:
http://people.redhat.com/clalance/libdeltacloud/0.8
The source code is pushed to the git repository, which lives here:
git://git.fedorahosted.org/deltacloud/libdeltacloud.git
As always, questions, comments, problems and patches are welcome!
--
Chris Lalancette
13 years
Setting up Pulp with Conductor
by Martyn Taylor
Hi Gents,
I sent this a few days back, but attached it to one of my patches, so ppl might not have got it.
Anyways, its a very brief guide for anyone who is unsure on how to set up Pulp with Conductor.
Cheers,
Martyn
-------------------------
N.B. Alot of the documentation on the Pulp website is outdated. For the latest API Doc see: https://fedorahosted.org/pulp/wiki/UGREST-Repositories
1. Install pulp and sync with a repository. You can get information on how to do this from the pulp website:
http://pulpproject.org/ug/index.html
2. Sync with a Repo:
Again you can get information on how to do this from the UserGuide on the Pulp website.
I would recommend syncing with a relatively small repo, since it takes ages, I used one of our aeolus-repos
3. Add the pulp repo to the image_descriptor_package_repository.xml, (located in under config dir in conductor)
You should add the Pulp admin username and password in the url. Here is my config entry:
-
baseurl: https://admin:admin@localhost/pulp/api/
yumurl: https://localhost/pulp/repos/
type: pulp
4. Add your sync'd repository image_descriptor_platform_repository.
Its id should be the same id you gave pulp when you sync'd
I called mine fedora in pulp so this is what I have:
fedora:
name: Fedora
version: 14
architecture: x86_64
Once you have this your good to go
N.B.: When you add pulp repo. The existing Fedora repo packages are not shown, Something we need to address. You can search in the search box on templates page.
13 years