Aeolus release naming/numbering suggestions?
by Justin Clift
Hi all,
Thinking about numbering systems we can use, and trying
to figure out the best approach for Aeolus.
For example, should we start with 0.1.0, or 0.5.0, 1.0.0,
or something else? (ie Aeolus 0.1.0)
Also what do we call this initial version we're putting
together for this sprint? It won't be production
quality, but we're aiming for people to be able to try
it out.
I'm thinking maybe "Alpha 1"?
i.e. Aeolus 0.1.0 Alpha 1 or similar
Good/bad idea, etc?
Regards and best wishes,
Justin Clift
12 years, 11 months
[PATCH conductor] Fixed typo in pool_family controller
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
---
.../controllers/admin/pool_families_controller.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/app/controllers/admin/pool_families_controller.rb b/src/app/controllers/admin/pool_families_controller.rb
index 1d242f8..9f53113 100644
--- a/src/app/controllers/admin/pool_families_controller.rb
+++ b/src/app/controllers/admin/pool_families_controller.rb
@@ -58,7 +58,7 @@ class Admin::PoolFamiliesController < ApplicationController
if @url_params.delete :details_pane
render :partial => 'layouts/details_pane' and return
end
- render :parial => @details_tab and return
+ render :partial => @details_tab and return
end
format.html { render :show }
end
--
1.7.4
12 years, 11 months
[PATCH] Remove dependency on aeolus-conductor-doc
by Matt Wagner
It shouldn't matter to Puppet whether the documentation is installed.
---
recipes/aeolus_recipe/manifests/conductor.pp | 3 +--
spec/spec_helper.rb | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/recipes/aeolus_recipe/manifests/conductor.pp b/recipes/aeolus_recipe/manifests/conductor.pp
index d1ac9a9..733c9be 100644
--- a/recipes/aeolus_recipe/manifests/conductor.pp
+++ b/recipes/aeolus_recipe/manifests/conductor.pp
@@ -4,8 +4,7 @@ class aeolus::conductor inherits aeolus {
### Install the aeolus components
# specific versions of these two packages are needed and we need to pull the third in
package {['aeolus-conductor',
- 'aeolus-conductor-daemons',
- 'aeolus-conductor-doc']:
+ 'aeolus-conductor-daemons']:
ensure => 'installed'}
# to be renamed to aeolus-connector
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 143b2ce..3fde1de 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -7,7 +7,7 @@ $test_scripts = ($test_scripts != "false" && $test_scripts != "n")
AEOLUS_PACKAGES = ['iwhd', 'imagefactory',
'rubygem-deltacloud-core', 'rubygem-deltacloud-client',
- 'aeolus-conductor', 'aeolus-conductor-doc', 'aeolus-conductor-daemons',
+ 'aeolus-conductor', 'aeolus-conductor-daemons',
'aeolus-configure']
AEOLUS_SERVICES = ['iwhd', 'deltacloud-mock', 'deltacloud-ec2-us-east-1', 'deltacloud-ec2-us-west-1', 'imagefactory',
--
1.7.4.2
12 years, 11 months
Redmine #692 (rebased 2)
by Tomas Sedovic
This fixes the tastk #692.
Since this changed things in the factory and condor interfaces, please make
sure that you do a full end-end testing (building a new image, uploading it to
the cloud and starting an instance) when reviewing this.
12 years, 11 months
[PATCH 0/6]: Fix up condor_refreshd
by Chris Lalancette
There are several bugs in refreshing the current classads that this
series fixes. Note that I have not tested these patches as-is
yet; I wanted to post them to get review while I test. Please
take a look and give feedback.
12 years, 11 months
[PATCH aeolus] Rewrite condor_refreshd to start in condor_job
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
src/app/util/condormatic.rb | 24 +++++++++++
src/condor_refreshd/condor_refreshd | 78 +++++++++++------------------------
2 files changed, 48 insertions(+), 54 deletions(-)
diff --git a/src/app/util/condormatic.rb b/src/app/util/condormatic.rb
index 572f413..4aa1139 100644
--- a/src/app/util/condormatic.rb
+++ b/src/app/util/condormatic.rb
@@ -292,6 +292,30 @@ def condormatic_classads_sync
Rails.logger.info "done"
end
+def condormatic_queue_classad_sync(timeout)
+ begin
+ pipe = IO.popen("condor_submit 2>&1", "w+")
+ pipe.puts "Executable = /usr/share/aeolus-conductor/condor_refreshd/condor_refreshd\n"
+ Rails.logger.info "Executable = /usr/share/aeolus-conductor/condor_refreshd/condor_refreshd\n"
+ pipe.puts "Requirements = true\n"
+ Rails.logger.info "Requirements = true\n"
+ pipe.puts "environment = RAILS_ENV=production\n"
+ Rails.logger.info "environment = RAILS_ENV=production\n"
+ pipe.puts "Queue\n"
+ Rails.logger.info "Queue\n"
+ pipe.close_write
+ out = pipe.read
+ pipe.close
+
+ @logger.error "$? (return value?) is #{$?}"
+ raise ("Error calling condor_submit: #{out}") if $? != 0
+
+ rescue Exception => ex
+ @logger.error ex.message
+ @logger.error ex.backtrace
+ end
+end
+
def kick_condor
begin
socket = Socket.new(Socket::AF_INET, Socket::SOCK_DGRAM, 0)
diff --git a/src/condor_refreshd/condor_refreshd b/src/condor_refreshd/condor_refreshd
index 273902f..2bc5803 100755
--- a/src/condor_refreshd/condor_refreshd
+++ b/src/condor_refreshd/condor_refreshd
@@ -26,33 +26,23 @@ require 'optparse'
require 'socket'
require 'dutils'
-port = 7890
help = false
-daemon = true
-refreshd_log_dir = "/var/log/aeolus-conductor"
-refreshd_pid_dir = "/var/run/aeolus-conductor"
-timeout = 15
+delay = 0
+refreshd_log_dir = "/var/log/aeolus-conductor/"
+refresh_log = "condor_refreshd.log"
optparse = OptionParser.new do |opts|
-
opts.banner = <<BANNER
Usage: condor_refreshd [options]
Options:
BANNER
- opts.on( '-f', '--pid-file PATH', "Use PATH to the condor_refreshd pid directory (defaults to #{refreshd_pid_dir})") do |newpath|
- refreshd_pid_dir = newpath
- end
opts.on( '-h', '--help', '') { help = true }
opts.on( '-l', '--log PATH', "Use PATH to the condor_refreshd log directory (defaults to #{refreshd_log_dir}). Use '-' for stdout") do |newpath|
refreshd_log_dir = newpath
end
- opts.on( '-n', '--nodaemon', 'Do not daemonize (useful in combination with -l for debugging)') { daemon = false }
- opts.on( '-p', '--port PORT', 'Use PORT (default: 7890)') do |newport|
- port = newport
- end
- opts.on( '-t', '--timeout TIMEOUT', 'Automatically refresh classads after TIMEOUT minutes') do |newtime|
- timeout = newtime
+ opts.on( '-d', '--delay SECONDS', 'do not run for SECONDS before refreshing classads.') do |newdelay|
+ delay = newdelay
end
end
@@ -76,49 +66,29 @@ if refreshd_log_dir == '-'
else
REFRESHD_LOG_FILE = "#{refreshd_log_dir}/condor_refreshd.log"
end
-logger = Logger.new(REFRESHD_LOG_FILE)
-logger.level = Logger::DEBUG
-logger.info "Starting condor_refreshd..."
-socket = Socket.new(Socket::AF_INET, Socket::SOCK_DGRAM, 0)
-in_addr = Socket.pack_sockaddr_in(port, '127.0.0.1')
-socket.bind(in_addr)
+logger = Logger.new(REFRESHD_LOG_FILE)
-# daemonize
-if daemon
- # note that this requires 'active_support', which we get for free from dutils
- Process.daemon
-end
+logger.level = Logger::DEBUG
begin
- REFRESHD_PID_FILE = "#{refreshd_pid_dir}/condor_refreshd.pid"
- FileUtils.mkdir_p File.dirname(REFRESHD_PID_FILE)
- open(REFRESHD_PID_FILE, "w") {|f| f.write(Process.pid) }
- File.chmod(0644, REFRESHD_PID_FILE)
-
- while true
- begin
- condormatic_classads_sync
- results = select([socket], nil, nil, timeout * 60)
-
- # if results was nil, we timed out waiting, and we need to do a sync
- # but not read from the socket
- if not results.nil? and results[0][0] == socket
- socket.recvfrom(1024)
- logger.info "Doing classad sync after getting data from the socket"
- else
- logger.info "Doing classad sync after timeout"
- end
- rescue => e
- logger.error "#{e.backtrace.shift}: #{e.message}"
- e.backtrace.each do |step|
- logger.error "\tfrom #{step}"
- end
+ # Ideally get the start time here.
+ #sleep(delay)
+ sleep(20)
+ begin
+ logger.info("----------------------------------------------")
+ logger.info(Time.now.to_s + ": " + "Executing ClassAd Sync")
+ condormatic_classads_sync
+ rescue => e
+ logger.error "#{e.backtrace.shift}: #{e.message}"
+ e.backtrace.each do |step|
+ logger.error "\tfrom #{step}"
end
end
-rescue => e
- logger.error "#{e.backtrace.shift}: #{e.message}"
- e.backtrace.each do |step|
- logger.error "\tfrom #{step}"
- end
+ # Get the end time, calculate elapsed time, subtract it from 55 (5 sec buffer), and use that as the arg to the timeout.
+ condormatic_queue_classad_sync(30)
+
+ logger.info(Time.now.to_s + ": Refresh Completed")
+ logger.info("----------------------------------------------")
+ exit(0)
end
--
1.7.4
12 years, 11 months
[PATCH conductor] Set setsebool httpd_can_network_connect to rpm conductor spec
by Francesco Vollero
From: Francesco Vollero <fvollero(a)redhat.com>
With this patch we get a more easy and "invisible" way to set the bool in selinux to activate httpd_can_network_connect just after the installation of the rpm, allowing aeolus-configure to have it just working.
If this patch gonna be ack'd we should remove the puppet recipe that was activating it with aeolus-configure.
---
aeolus-conductor.spec.in | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/aeolus-conductor.spec.in b/aeolus-conductor.spec.in
index e5f7d62..7fb095b 100644
--- a/aeolus-conductor.spec.in
+++ b/aeolus-conductor.spec.in
@@ -64,6 +64,7 @@ Requires: %{name} = %{version}-%{release}
Requires: httpd >= 2.0
Requires: rubygem(thin) >= 1.2.5
Requires(post): chkconfig
+Requires(post): /usr/sbin/setsebool, /usr/sbin/selinuxenabled
Requires(preun): chkconfig
Requires(preun): initscripts
@@ -277,6 +278,10 @@ if [ ! -d %{app_root}/app ]; then
fi
%post daemons
+# Activate httpd_can_network_connect (for httpd mod_proxy module)
+if /usr/sbin/selinuxenabled ; then
+ /usr/sbin/setsebool -P httpd_can_network_connect 1 2>/dev/null
+fi
# Register the services
/sbin/chkconfig --add aeolus-conductor
/sbin/chkconfig --add conductor-dbomatic
--
1.7.4.4
12 years, 11 months
[PATCH conductor] BZ695770 / Task 1173 - instance creation gui needs redhat/fedora logos
by Richard Su
Added logos for fedora and rhel. The image url uses tpl.platform which
includes the version number. May be worth refactoring that to drop the
version number. At the moment there are symlinks for each version
pointing to the single fedora logo.
Display of RHEL logo is untested. RHEL image imports sets the
tpl.platform value to "unknown". As a temporary measure, I've added
a conditional to not display an image if the value is "unknown".
---
.../views/resources/instances/select_template.haml | 3 ++-
src/public/images/platform_fedora.png | Bin 0 -> 1109 bytes
src/public/images/platform_fedora13.png | 1 +
src/public/images/platform_fedora14.png | 1 +
src/public/images/platform_fedora15.png | 1 +
src/public/images/platform_rhel.png | Bin 0 -> 1399 bytes
6 files changed, 5 insertions(+), 1 deletions(-)
create mode 100644 src/public/images/platform_fedora.png
create mode 120000 src/public/images/platform_fedora13.png
create mode 120000 src/public/images/platform_fedora14.png
create mode 120000 src/public/images/platform_fedora15.png
create mode 100644 src/public/images/platform_rhel.png
diff --git a/src/app/views/resources/instances/select_template.haml b/src/app/views/resources/instances/select_template.haml
index ab0cfc4..a2dfbeb 100644
--- a/src/app/views/resources/instances/select_template.haml
+++ b/src/app/views/resources/instances/select_template.haml
@@ -5,7 +5,8 @@
%li
- form_tag new_resources_instance_path do
= hidden_field :instance, :template_id, :value => tpl.id
- = image_tag "platform_#{tpl.platform}.png", :size => "32x32", :alt => tpl.platform
+ - if tpl.platform != "unknown"
+ = image_tag "platform_#{tpl.platform}.png", :size => "32x32", :alt => tpl.platform
%h3= tpl.name
%p= tpl.summary
%p
diff --git a/src/public/images/platform_fedora.png b/src/public/images/platform_fedora.png
new file mode 100644
index 0000000000000000000000000000000000000000..3b0f3106e22eb870ea33abc02dc6a0b9aadde7dd
GIT binary patch
literal 1109
zcmV-b1giUqP)<h;3K|Lk000e1NJLTq001BW001Be0ssI2{21+{00001b5ch_0Itp)
z=>Px(4@pEpR7l6|mR)RAMHI)+nYs7w$Gz<qrCVsT)K>cyON~w8ff}vw;DdsRMSU?g
z(L@rd*hE93HnF@STGGUXssR;*DoAU!kn#~*sFeVUSQW4(6#JD*KX$txx4rkyj1RY2
zm)&JoV~8>FJl>f(znL@t|Cx(I2)La=;5Ns9A0VY37D6B*0L=PB<C8ObWPwnksZL++
zQkTo|j{tUR#(CGV^DXapj*d^svP1}i0LHmtSgY<YYS{Gn>dNBO08FYPJA41xOV4fD
z>2f*jL&T0U&H(@fcrw-ft*`p>vZH5B53r~1c=zz$&%UOV#0^nOt13$#T~{ef^z?UE
zyHB1A`sZ4k>uc7mOv;D{*ps%m9BS)0od{l*bH~xPrsy;w#Mahxr%v{UCx+i^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public/images/platform_fedora13.png
new file mode 120000
index 0000000..b44d871
--- /dev/null
+++ b/src/public/images/platform_fedora13.png
@@ -0,0 +1 @@
+platform_fedora.png
\ No newline at end of file
diff --git a/src/public/images/platform_fedora14.png b/src/public/images/platform_fedora14.png
new file mode 120000
index 0000000..b44d871
--- /dev/null
+++ b/src/public/images/platform_fedora14.png
@@ -0,0 +1 @@
+platform_fedora.png
\ No newline at end of file
diff --git a/src/public/images/platform_fedora15.png b/src/public/images/platform_fedora15.png
new file mode 120000
index 0000000..b44d871
--- /dev/null
+++ b/src/public/images/platform_fedora15.png
@@ -0,0 +1 @@
+platform_fedora.png
\ No newline at end of file
diff --git a/src/public/images/platform_rhel.png b/src/public/images/platform_rhel.png
new file mode 100644
index 0000000000000000000000000000000000000000..7a144a4ffa64408af3d66dc3b3504de5d8a93ff0
GIT binary patch
literal 1399
zcmV--1&I2IP)<h;3K|Lk000e1NJLTq001BW0018d0ssI22{c&S00001b5ch_0Itp)
z=>Px)F-b&0R7l6QR$XWmR}?<?&YhV%yF0sUVs=ACS%rWp+eo($nkd;yOPf4|K9~(Y
zw4_!+TB?D9^wpAw{saj%q*WuOAs8Zk32lB5O%Yo(4UyG{ZK9I6OGwwH)tddunAzRA
zeYj+t%p_JUJ<P+*opa82&Ueo}_aMd?tQE!>LI?m>R#vjvY$A~u9v)s?T%4bu#~34o
zwrtt5bLY-zG+JL@PbrmU*=hw&ccvJIVHgH~zjWzRdwaXz?}v@0s;cVn;lo$1Trtg=
zL%_Lo^XAP12M%~V9(X=cRW%li-MxF)7NQ-1|G0elav%^ejrRz`NlH)3@<BrC1>tQ%
zPE-1e+db)ae@>|trn0hfbad322UwSehK4Z4rcG23@?J0V`K(Xg>-|nqUdH$grN65x
zwqQt-G&neD!*~iXHa2FBNCfDi^lt|M^ZEWz)ecGOp_KW2U#`tVmSw&rCI;}gsi~=8
zFlbeE16*^v4~gRYlJpg&heYuUS=PK>!{;koP-i@z9cznc^XAR>?%gvnfH77m6q=fv
zY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7N+nG#e9g3bIwhLX;v{)<#
z0F8}}b8~a%I;U~NvE}(Oy1Tn6rCnWJckbM={e5~Tvlo?kJWdGVqsm587h{aPaKpKJ
z^=dpG4~N6N7S^8|0nooTnT<LR_qgFm`X2$FUoia7@(<SJ9r3X<qP_qC002ovPDHLk
FV1jh7nbH6N
literal 0
HcmV?d00001
--
1.7.4.2
12 years, 11 months
Update/Create new UI for creating pools (rev.1)
by Jirka Tomasek
rev. 1 - fixed failing cucumber test
Feature #1075: As an SA I want to create a pool
Task #1100 Update/Create new UI for creating pools
The Pool create/edit form must include setting the quota and the pool
family this pool is associated with.
12 years, 11 months
[PATCH] Ability to create Deployables and add Assemblies to them
by Matt Wagner
---
.../image_factory/deployables_controller.rb | 21 ++++++++++++++-
.../image_factory/deployables/_assemblies.haml | 28 ++++++++++++++++++++
src/app/views/image_factory/deployables/_form.haml | 3 ++
.../deployables/_pick_assemblies.haml | 15 ++++++++++
src/config/locales/en.yml | 1 +
src/config/routes.rb | 2 +-
6 files changed, 68 insertions(+), 2 deletions(-)
create mode 100644 src/app/views/image_factory/deployables/_assemblies.haml
create mode 100644 src/app/views/image_factory/deployables/_pick_assemblies.haml
diff --git a/src/app/controllers/image_factory/deployables_controller.rb b/src/app/controllers/image_factory/deployables_controller.rb
index 5b8210c..1654a5c 100644
--- a/src/app/controllers/image_factory/deployables_controller.rb
+++ b/src/app/controllers/image_factory/deployables_controller.rb
@@ -8,7 +8,7 @@ class ImageFactory::DeployablesController < ApplicationController
def show
@deployable = Deployable.find(params[:id])
@url_params = params.clone
- @tab_captions = ['Properties']
+ @tab_captions = ['Properties', 'Assemblies']
@details_tab = params[:details_tab].blank? ? 'properties' : params[:details_tab]
respond_to do |format|
format.js do
@@ -41,6 +41,9 @@ class ImageFactory::DeployablesController < ApplicationController
def update
@deployable = Deployable.find(params[:id])
+ if assemblies = params.delete(:assemblies_selected)
+ @deployable.assembly_ids += assemblies.collect{|a| a.to_i}
+ end
if @deployable.update_attributes(params[:deployable])
flash[:notice] = "Deployable updated."
redirect_to image_factory_deployable_url(@deployable)
@@ -54,6 +57,22 @@ class ImageFactory::DeployablesController < ApplicationController
redirect_to image_factory_deployables_url
end
+ def pick_assemblies
+ @deployable = Deployable.find(params[:id], :include => :assemblies)
+ @assemblies = Assembly.all - @deployable.assemblies
+ render :partial => 'pick_assemblies'
+ end
+
+ def remove_assemblies
+ @deployable = Deployable.find(params[:id], :include => :assemblies)
+ @deployable.assembly_ids = @deployable.assembly_ids - params[:assemblies_selected].collect{|a| a.to_i}
+ @deployable.save!
+ respond_to do |format|
+ format.js { render :partial => 'assemblies' }
+ format.html { redirect_to image_factory_deployable_url(@deployable) and return }
+ end
+ end
+
protected
def load_deployables
diff --git a/src/app/views/image_factory/deployables/_assemblies.haml b/src/app/views/image_factory/deployables/_assemblies.haml
new file mode 100644
index 0000000..47f9f66
--- /dev/null
+++ b/src/app/views/image_factory/deployables/_assemblies.haml
@@ -0,0 +1,28 @@
+.grid_13
+- form_tag do
+ = restful_submit_tag "Remove Selected", 'destroy', remove_assemblies_image_factory_deployable_path(@deployable), 'DELETE', :id => 'delete_button'
+ = link_to "Add Assembly...", pick_assemblies_image_factory_deployable_path(@deployable), :class => 'button', :id => 'add_assembly'
+
+ %table#assemblies_table
+ %thead
+ %tr
+ %th
+ %th= "Name"
+ %th= "Created"
+ -@deployable.assemblies(:include => :templates).each do |assembly|
+ %tr
+ %td
+ %input{:name => "assemblies_selected[]", :type => "checkbox", :value => assembly.id, :id => "assembly_checkbox_#{assembly.id}" }
+ %td= assembly.name
+ %td= assembly.created_at
+
+:javascript
+ $(document).ready(function () {
+ $('#add_assembly').click(function(e) {
+ e.preventDefault();
+ var url = $(this).attr('href');
+ $.get(url, function(data) {
+ $('#ui-tabs-2').html(data);
+ });
+ });
+ });
\ No newline at end of file
diff --git a/src/app/views/image_factory/deployables/_form.haml b/src/app/views/image_factory/deployables/_form.haml
index cd08ebc..98c2232 100644
--- a/src/app/views/image_factory/deployables/_form.haml
+++ b/src/app/views/image_factory/deployables/_form.haml
@@ -2,6 +2,9 @@
%fieldset.clear
= form.label :name, t(:name), :class => "grid_3 alpha"
= form.text_field :name, :class => "grid_5"
+%fieldset.clear
+ = form.label :summary, t(:summary), :class => "grid_3 alpha"
+ = form.text_area :summary, :class => "grid_5", :rows => 3
%fieldset.clearfix
= form.submit "Save", :class => "submit formbutton"
= link_to t(:cancel), image_factory_deployables_path, :class => 'button formbutton'
diff --git a/src/app/views/image_factory/deployables/_pick_assemblies.haml b/src/app/views/image_factory/deployables/_pick_assemblies.haml
new file mode 100644
index 0000000..a049451
--- /dev/null
+++ b/src/app/views/image_factory/deployables/_pick_assemblies.haml
@@ -0,0 +1,15 @@
+.grid_13
+ - form_tag(image_factory_deployable_path(@deployable)) do
+ %table#assemblies_list
+ %thead
+ %tr
+ %th
+ %th= "Name"
+ -(a)assemblies.each do |assembly|
+ %tr
+ %td
+ %input{:name => "assemblies_selected[]", :type => "checkbox", :value => assembly.id, :id => "assembly_checkbox_#{assembly.id}" }
+ %td= assembly.name
+
+ -# AJAX post
+ = restful_submit_tag('Save', 'update', image_factory_deployable_path(@deployable), 'PUT')
\ No newline at end of file
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 7510a05..58673e0 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -90,6 +90,7 @@ en:
not_deleted: "Could not delete the following Pool Families: %{list}."
setting: Settings
name: Name
+ summary: Summary
admin:
settings:
index:
diff --git a/src/config/routes.rb b/src/config/routes.rb
index 162260c..6eef181 100644
--- a/src/config/routes.rb
+++ b/src/config/routes.rb
@@ -44,7 +44,7 @@ ActionController::Routing::Routes.draw do |map|
map.namespace 'image_factory' do |r|
r.resources :assemblies
r.resources :image_imports
- r.resources :deployables, :collection => { :multi_destroy => :delete }
+ r.resources :deployables, :collection => { :multi_destroy => :delete }, :member => { :pick_assemblies => :get, :remove_assemblies => :delete }
r.resources :templates, :collection => {:collections => :get, :add_selected => :get, :metagroup_packages => :get, :remove_package => :get, :multi_destroy => :delete}
r.connect "/builds/update_status.:format", :controller => :builds, :action => :update_status
r.resources :builds, :collection => { :delete => :delete, :upload => :get, :retry => :post }
--
1.7.4.2
12 years, 11 months