Stop instances from deployment view
by Jirka Tomasek
This fixes BZ719404. Instances table is accessible from Pools#index,
Deployment#show filter views and Instances#index (which is not available
from UI), Instances table partial now resides in
app/views/instances/_list.haml
12 years, 9 months
configure: Change rake syntax to work with Rails 3, too
by Matt Wagner
This shouldn't break anything on Rails 2 / rake 0.8.7, but it does fix dc:create_user from aeolus-configure on Rails 3 / rake 0.9.
I don't think I have commit access to configure, so if this is ACK'd, could someone with push privs do that for me?
Best,
Matt
12 years, 9 months
[PATCH aeolus] BZ#719382 Enable aeolus-image push --build, throw error on push via image twice
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
.../aeolus-image/lib/config_parser.rb | 4 ++--
.../image_factory/aeolus-image/lib/push_command.rb | 19 ++++++++++++++++++-
.../aeolus-image/man/aeolus-image-push.1 | 6 +++++-
3 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/services/image_factory/aeolus-image/lib/config_parser.rb b/services/image_factory/aeolus-image/lib/config_parser.rb
index 60b40cd..8e98971 100644
--- a/services/image_factory/aeolus-image/lib/config_parser.rb
+++ b/services/image_factory/aeolus-image/lib/config_parser.rb
@@ -141,8 +141,8 @@ module Aeolus
opts.separator ""
opts.separator "Push examples:"
- opts.separator "aeolus-image push --provider ec2-us-east-1 --id $image_id # push the image to the specified provider"
- opts.separator "aeolus-image push --build $build_id # (NOT IMPLEMENTED) push all target images for a build, to same providers as previously"
+ opts.separator "aeolus-image push --provider ec2-us-east-1 --id $image_id # initial push of an image build via image id to the specified provider"
+ opts.separator "aeolus-image push --build $build_id # push an image build via build id to the specified provider"
opts.separator "aeolus-image push --account $provider_account --build $build_id # (NOT IMPLEMENTED) ditto, using a specific provider account"
opts.separator "aeolus-image push --image $image_id # (NOT IMPLEMENTED) push all the target images for the latest build"
diff --git a/services/image_factory/aeolus-image/lib/push_command.rb b/services/image_factory/aeolus-image/lib/push_command.rb
index 69a0776..b2c863e 100644
--- a/services/image_factory/aeolus-image/lib/push_command.rb
+++ b/services/image_factory/aeolus-image/lib/push_command.rb
@@ -18,6 +18,14 @@ module Aeolus
def run
begin
if combo_implemented?
+ if !@options[:id].empty?
+ if pushed?(@options[:id])
+ puts "ERROR: This image has already been pushed, to push to another provider please push via build-id rather than image-id"
+ puts "e.g. aeolus-image push --provider <provider> --build <build-id>"
+ quit(1)
+ end
+ end
+
sleep(5)
@console.push(@options[:provider], get_creds, @options[:id], @options[:build]).each do |adaptor|
puts ""
@@ -40,7 +48,7 @@ module Aeolus
end
def combo_implemented?
- if @options[:provider].empty? || @options[:id].empty?
+ if @options[:provider].empty? || (@options[:build].empty? && @options[:id].empty?)
puts "This combination of parameters is not currently supported"
quit(1)
end
@@ -52,6 +60,15 @@ module Aeolus
@console.shutdown
exit(code)
end
+
+ def pushed?(image)
+ begin
+ uuid = Regexp.new('[\w]{8}[-][\w]{4}[-][\w]{4}[-][\w]{4}[-][\w]{12}')
+ uuid.match(iwhd["/images/" + image + "/latest_unpushed"].get).nil? ? true : false
+ rescue
+ true
+ end
+ end
end
end
end
diff --git a/services/image_factory/aeolus-image/man/aeolus-image-push.1 b/services/image_factory/aeolus-image/man/aeolus-image-push.1
index 76fab4e..c2e0215 100644
--- a/services/image_factory/aeolus-image/man/aeolus-image-push.1
+++ b/services/image_factory/aeolus-image/man/aeolus-image-push.1
@@ -26,10 +26,14 @@ Get usage information for this command and associated commmands
\-h, --help
.SH EXAMPLES
.TP
-Push an image with id 12345678-bbbb-1234--1234567890ab to provider ec2-us-east-1
+Initial push of an image with id 12345678-bbbb-1234--1234567890ab to provider ec2-us-east-1
.B aeolus-image push
\--id 12345678-bbbb-1234--1234567890ab
\--provider ec2-us-east-1
+Push a build with id 12345678-bbbb-1234--1234567890ab to provider ec2-us-east-1
+.B aeolus-image push
+\--build 12345678-bbbb-1234--1234567890ab
+\--provider ec2-us-east-1
.SH AUTHOR
Martyn Taylor (mtaylor(a)redhat.com), Jason Guiditta (jguiditta(a)redhat.com)
.SH SEE ALSO
--
1.7.4
12 years, 9 months
[PATCH aeolus] BZ#720761 List Imported Images
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
List the invalid images
---
.../image_factory/aeolus-image/lib/list_command.rb | 49 +++++++++++++++----
1 files changed, 38 insertions(+), 11 deletions(-)
diff --git a/services/image_factory/aeolus-image/lib/list_command.rb b/services/image_factory/aeolus-image/lib/list_command.rb
index 4a02818..e8a4f67 100644
--- a/services/image_factory/aeolus-image/lib/list_command.rb
+++ b/services/image_factory/aeolus-image/lib/list_command.rb
@@ -8,23 +8,28 @@ module Aeolus
def images
images = [["UUID", "NAME", "TARGET", "OS", "OS VERSION", "ARCH", "DESCRIPTION"]]
doc = Nokogiri::XML iwhd['/target_images'].get
+ # Check for any invalid data in iwhd
+ invalid_images = []
doc.xpath("/objects/object/key").each do |targetimage|
begin
- build = iwhd["/target_images/" + targetimage + "/build"].get
+ build = iwhd["/target_images/" + targetimage.text + "/build"].get
image = iwhd["/builds/" + build + "/image"].get
- template_xml = Nokogiri::XML iwhd["/templates/" + iwhd["/target_images/" + targetimage + "/template"].get].get
-
- images << [image,
- template_xml.xpath("/template/name").text,
- iwhd["/target_images/" + targetimage + "/target"].get,
- template_xml.xpath("/template/os/name").text,
- template_xml.xpath("/template/os/version").text,
- template_xml.xpath("/template/os/arch").text,
- template_xml.xpath("/template/description").text]
- rescue RestClient::ResourceNotFound, RestClient::InternalServerError
+ template_info = get_template_info(image, targetimage.text)
+ if template_info
+ images << template_info
+ else
+ images << [image, get_image_name(image), iwhd["/target_images/" + targetimage + "/target"].get, "", "", "", ""]
+ end
+ rescue
+ invalid_images << targetimage.text
end
end
format_print(images)
+
+ unless invalid_images.empty?
+ puts "\nN.B. following images were not listed, aeolus-image encountered some invalid data in iwhd:"
+ puts invalid_images.join "\n"
+ end
quit(0)
end
@@ -100,6 +105,28 @@ module Aeolus
puts ""
end
end
+
+ def get_template_info(image, targetimage)
+ begin
+ template = Nokogiri::XML iwhd["/templates/" + iwhd["/target_images/" + targetimage + "/template"].get].get
+ [image, template.xpath("/template/name").text,
+ iwhd["/target_images/" + targetimage + "/target"].get,
+ template.xpath("/template/os/name").text,
+ template.xpath("/template/os/version").text,
+ template.xpath("/template/os/arch").text,
+ template.xpath("/template/description").text]
+ rescue
+ end
+ end
+
+ def get_image_name(image)
+ begin
+ template_xml = Nokogiri::XML iwhd["images/" + image].get
+ template_xml.xpath("/image/name").text
+ rescue
+ ""
+ end
+ end
end
end
end
--
1.7.4
12 years, 9 months
[PATCH conductor] Change CSS for 'Pool Details' link in pools/_pretty_list
by jzigmund@redhat.com
---
src/app/stylesheets/custom.scss | 5 +++++
src/app/views/pools/_pretty_list.haml | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/app/stylesheets/custom.scss b/src/app/stylesheets/custom.scss
index d6dab6a..e4aedd9 100644
--- a/src/app/stylesheets/custom.scss
+++ b/src/app/stylesheets/custom.scss
@@ -67,3 +67,8 @@ footer.standard{
#deployable-xml-link {
color: #666;
}
+
+.pool_details {
+ color: #333;
+ text-decoration: none;
+}
diff --git a/src/app/views/pools/_pretty_list.haml b/src/app/views/pools/_pretty_list.haml
index 07e2fb5..87d1cce 100644
--- a/src/app/views/pools/_pretty_list.haml
+++ b/src/app/views/pools/_pretty_list.haml
@@ -28,7 +28,7 @@
= render :partial => 'deployments', :locals => {:deployments => pool.deployments}
%ul.content.actions
%li
- %a{:href => pool_path(pool)}= "#{pool.name} Pool details »"
+ = link_to "#{pool.name} Pool details »", pool_path(pool), :class =>'pool_details'
%li
= link_to 'New Deployment', launch_new_deployments_path(:pool_id => pool.id), :class => 'button primary', :id => 'new_deployment_button'
--
1.7.4.4
12 years, 9 months
[PATCH conductor] BZ 719383 - check resources before launching new deployment
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
Now we try to find a launch match for each assembly in a deployment
before launch - errors are displayed to user on 'new' (deployment
overview) page
---
src/app/controllers/deployments_controller.rb | 7 +++++
src/app/models/deployment.rb | 31 +++++++++++++++++++++++
src/features/deployment.feature | 14 ++++++++++
src/spec/factories/hardware_profile_property.rb | 8 +++---
src/spec/models/deployment_spec.rb | 11 ++++++++
5 files changed, 67 insertions(+), 4 deletions(-)
diff --git a/src/app/controllers/deployments_controller.rb b/src/app/controllers/deployments_controller.rb
index 1bdd12c..f11885c 100644
--- a/src/app/controllers/deployments_controller.rb
+++ b/src/app/controllers/deployments_controller.rb
@@ -46,6 +46,13 @@ class DeploymentsController < ApplicationController
url = get_deployable_url
respond_to do |format|
if @deployment.accessible_and_valid_deployable_xml?(url)
+ errors = @deployment.check_assemblies_matches(current_user)
+ unless errors.empty?
+ flash[:error] = {
+ :summary => "It's not possible to launch some assemblies:",
+ :failures => errors
+ }
+ end
format.js { render :partial => 'new' }
format.html
format.json { render :json => @deployment }
diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
index 9a92f93..49b440a 100644
--- a/src/app/models/deployment.rb
+++ b/src/app/models/deployment.rb
@@ -183,4 +183,35 @@ class Deployment < ActiveRecord::Base
# I REALLY want to get this via a join, but no dice...
instances.first.provider_account.provider rescue nil
end
+
+ # we try to create an instance for each assembly and check
+ # if a match is found
+ def check_assemblies_matches(user)
+ errs = {}
+ deployable_xml.assemblies.each do |assembly|
+ begin
+ hw_profile = HardwareProfile.frontend.find_by_name(assembly.hwp)
+ raise "Hardware Profile #{assembly.hwp} not found." unless hw_profile
+ instance = Instance.new(
+ :deployment => self,
+ :name => "#{name}/#{assembly.name}",
+ :frontend_realm => frontend_realm,
+ :pool => pool,
+ :image_uuid => assembly.image_id,
+ :image_build_uuid => assembly.image_build,
+ :assembly_xml => assembly.to_s,
+ :state => Instance::STATE_NEW,
+ :owner => user,
+ :hardware_profile => hw_profile
+ )
+ possibles, errors = instance.matches
+ if possibles.empty? and not errors.empty?
+ raise errors.join(", ")
+ end
+ rescue
+ errs[assembly.name] = $!.message
+ end
+ end
+ errs
+ end
end
diff --git a/src/features/deployment.feature b/src/features/deployment.feature
index eda5123..2e7f368 100644
--- a/src/features/deployment.feature
+++ b/src/features/deployment.feature
@@ -182,3 +182,17 @@ Feature: Manage Deployments
When I follow "testdeployment"
And I press "Delete"
Then I should see "The deployment testdeployment was successfully deleted"
+
+ Scenario: Launch a deployment which is not launchable
+ Given a pool "mockpool" exists
+ And there is "front_hwp1" conductor hardware profile
+ When I am viewing the pool "mockpool"
+ And I follow "New Deployment"
+ Then I should see "New Deployment"
+ When I fill in "deployable_url" with "http://localhost/deployables/deployable1.xml"
+ When I fill in "deployment_name" with "mynewdeployment"
+ When I press "Next"
+ Then I should see "Deployable details"
+ And I should see "It's not possible to launch some assemblies:"
+ And I should see "backend: Hardware Profile front_hwp2 not found."
+
diff --git a/src/spec/factories/hardware_profile_property.rb b/src/spec/factories/hardware_profile_property.rb
index c752d8e..67e2a3e 100644
--- a/src/spec/factories/hardware_profile_property.rb
+++ b/src/spec/factories/hardware_profile_property.rb
@@ -26,7 +26,7 @@ Factory.define :mock_hwp1_arch, :parent => :hardware_profile_property do |p|
p.name 'architecture'
p.kind 'fixed'
p.unit 'label'
- p.value 'i386'
+ p.value 'x86_64'
end
Factory.define :mock_hwp2_memory, :parent => :hardware_profile_property do |p|
@@ -146,7 +146,7 @@ Factory.define :ec2_hwp1_arch, :parent => :hardware_profile_property do |p|
p.name 'architecture'
p.kind 'fixed'
p.unit 'label'
- p.value 'i386'
+ p.value 'x86_64'
end
Factory.define :front_hwp3_memory, :parent => :hardware_profile_property do |p|
@@ -174,7 +174,7 @@ Factory.define :front_hwp3_arch, :parent => :hardware_profile_property do |p|
p.name 'architecture'
p.kind 'fixed'
p.unit 'label'
- p.value 'i386'
+ p.value 'x86_64'
end
Factory.define :hwpp_range, :parent => :hardware_profile_property do |p|
@@ -204,5 +204,5 @@ Factory.define :hwpp_arch, :parent => :hardware_profile_property do |p|
p.name 'architecture'
p.kind 'fixed'
p.unit 'label'
- p.value 'i386'
+ p.value 'x86_64'
end
diff --git a/src/spec/models/deployment_spec.rb b/src/spec/models/deployment_spec.rb
index 9482896..e6c423c 100644
--- a/src/spec/models/deployment_spec.rb
+++ b/src/spec/models/deployment_spec.rb
@@ -94,4 +94,15 @@ describe Deployment do
@deployment.should be_destroyable
expect { @deployment.destroy }.to change(Deployment, :count).by(-1)
end
+
+ it "should return errors when checking assemblies matches which are not launchable" do
+ user = Factory(:user)
+ image_id = @deployment.deployable_xml.assemblies.first.image_id
+ provider_name = Image.find(image_id).latest_build.provider_images.first.provider_name
+ provider = Factory(:mock_provider, :name => provider_name)
+ @deployment.pool.pool_family.provider_accounts = [Factory(:mock_provider_account, :label => 'testaccount', :provider => provider)]
+ @deployment.check_assemblies_matches(user).should be_empty
+ @deployment.pool.pool_family.provider_accounts.destroy_all
+ @deployment.check_assemblies_matches(user).should_not be_empty
+ end
end
--
1.7.4.4
12 years, 9 months
[PATCH aeolus] BZ#721050 - Removed references to multiple provider push in docs
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
.../aeolus-image/lib/config_parser.rb | 2 +-
.../image_factory/aeolus-image/lib/push_command.rb | 25 ++++++++++++--------
.../aeolus-image/man/aeolus-image-push.1 | 2 +-
3 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/services/image_factory/aeolus-image/lib/config_parser.rb b/services/image_factory/aeolus-image/lib/config_parser.rb
index c62b599..60b40cd 100644
--- a/services/image_factory/aeolus-image/lib/config_parser.rb
+++ b/services/image_factory/aeolus-image/lib/config_parser.rb
@@ -141,7 +141,7 @@ module Aeolus
opts.separator ""
opts.separator "Push examples:"
- opts.separator "aeolus-image push --provider ec2-us-east-1,my-rhev-m --id $image_id # push the image to the specified providers"
+ opts.separator "aeolus-image push --provider ec2-us-east-1 --id $image_id # push the image to the specified provider"
opts.separator "aeolus-image push --build $build_id # (NOT IMPLEMENTED) push all target images for a build, to same providers as previously"
opts.separator "aeolus-image push --account $provider_account --build $build_id # (NOT IMPLEMENTED) ditto, using a specific provider account"
opts.separator "aeolus-image push --image $image_id # (NOT IMPLEMENTED) push all the target images for the latest build"
diff --git a/services/image_factory/aeolus-image/lib/push_command.rb b/services/image_factory/aeolus-image/lib/push_command.rb
index ae79f14..69a0776 100644
--- a/services/image_factory/aeolus-image/lib/push_command.rb
+++ b/services/image_factory/aeolus-image/lib/push_command.rb
@@ -16,17 +16,22 @@ module Aeolus
@console.start
end
def run
- if combo_implemented?
- sleep(5)
- @console.push(@options[:provider], get_creds, @options[:id], @options[:build]).each do |adaptor|
- puts ""
- puts "Provider Image: #{adaptor.image_id}"
- puts "Image: #{adaptor.image}"
- puts "Build: #{adaptor.build}"
- puts "Status: #{adaptor.status}"
- puts "Percent Complete: #{adaptor.percent_complete}"
+ begin
+ if combo_implemented?
+ sleep(5)
+ @console.push(@options[:provider], get_creds, @options[:id], @options[:build]).each do |adaptor|
+ puts ""
+ puts "Provider Image: #{adaptor.image_id}"
+ puts "Image: #{adaptor.image}"
+ puts "Build: #{adaptor.build}"
+ puts "Status: #{adaptor.status}"
+ puts "Percent Complete: #{adaptor.percent_complete}"
+ end
+ quit(0)
end
- quit(0)
+ rescue
+ puts "An Error occured whilst trying to push this build, please check aeolus-image --help for details on how to use this command"
+ quit(1)
end
end
diff --git a/services/image_factory/aeolus-image/man/aeolus-image-push.1 b/services/image_factory/aeolus-image/man/aeolus-image-push.1
index 2f92c0f..76fab4e 100644
--- a/services/image_factory/aeolus-image/man/aeolus-image-push.1
+++ b/services/image_factory/aeolus-image/man/aeolus-image-push.1
@@ -14,7 +14,7 @@ Conductor username
Conductor password
.TP
\-r|--provider
-The a list of the provider names this image should be pushed to
+The provider name this image should be pushed to
.TP
\--id <id>
The id of the image for pushing
--
1.7.4
12 years, 9 months
[PATCH configure 1/1] BZ 719674: VMWare configuration
by Mike Orazi
Add class & template to configure vmware/vsphere
---
conf/default_cleanup | 2 ++
conf/default_configure | 11 +++++++++++
recipes/aeolus/manifests/init.pp | 1 +
recipes/aeolus/manifests/vmware.pp | 29 +++++++++++++++++++++++++++++
recipes/aeolus/templates/vmware.json | 10 ++++++++++
5 files changed, 53 insertions(+), 0 deletions(-)
create mode 100644 recipes/aeolus/manifests/vmware.pp
create mode 100644 recipes/aeolus/templates/vmware.json
diff --git a/conf/default_cleanup b/conf/default_cleanup
index 5a5ce55..d43e906 100644
--- a/conf/default_cleanup
+++ b/conf/default_cleanup
@@ -20,3 +20,5 @@ classes:
- aeolus::conductor::remove_seed_data
# Uncomment this to clean up RHEV details
#- aeolus::rhevm::disabled
+# Uncomment to remove vmware
+#- aeolus::vmware::disabled
diff --git a/conf/default_configure b/conf/default_configure
index d60b11a..33ac7e1 100644
--- a/conf/default_configure
+++ b/conf/default_configure
@@ -25,6 +25,14 @@ parameters:
# rhevm_deltacloud_username: username@fqdn
# rhevm_deltacloud_password: password
# rhevm_deltacloud_powershell_url: https://rhevm.server.com:8543/rhevm-api-powershell
+#
+# Uncomment this section and provide appropriate values to configure vmware
+# vmware_api_endpoint: vsphere.server.com
+# vmware_username: username
+# vmware_password: password
+# vmware_datastore: datastore
+# vmware_network_name: network_name
+# vmware_deltacloud_port: 3006
classes:
- aeolus::conductor
- aeolus::image-factory
@@ -32,3 +40,6 @@ classes:
- aeolus::conductor::seed_data
# Uncomment this section to include rhev setup
#- aeolus::rhevm
+#
+# Uncomment this section to include vmware setup
+#- aeolus::vmware
diff --git a/recipes/aeolus/manifests/init.pp b/recipes/aeolus/manifests/init.pp
index b370064..7768733 100644
--- a/recipes/aeolus/manifests/init.pp
+++ b/recipes/aeolus/manifests/init.pp
@@ -11,6 +11,7 @@ import "deltacloud"
import "iwhd"
import "image-factory"
import "rhevm"
+import "vmware"
if $aeolus_enable_https == "true" or $aeolus_enable_https == "1" {
import "openssl"
diff --git a/recipes/aeolus/manifests/vmware.pp b/recipes/aeolus/manifests/vmware.pp
new file mode 100644
index 0000000..61e861d
--- /dev/null
+++ b/recipes/aeolus/manifests/vmware.pp
@@ -0,0 +1,29 @@
+class aeolus::vmware inherits aeolus {
+ file {"/etc/vmware.json":
+ content => template("aeolus/vmware.json"),
+ mode => 755,
+ require => Package['aeolus-conductor-daemons'] }
+
+ aeolus::conductor::hwp{"vsphere-hwp":
+ memory => "256",
+ cpu => "",
+ storage => "",
+ architecture => "x86_64",
+ require => Aeolus::Site_admin["admin"] }
+
+ aeolus::deltacloud{"vsphere":
+ provider_type => 'vsphere',
+ endpoint => "$vmware_api_endpoint",
+ port => $vmware_deltacloud_port}
+
+ aeolus::conductor::provider{"vsphere":
+ type => "vsphere",
+ url => "http://localhost:${vmware_deltacloud_port}/api",
+ require => [Aeolus::Deltacloud["vsphere"]]}
+
+}
+
+class aeolus::vmware::disabled {
+ aeolus::deltacloud::disabled{"vsphere": }
+
+}
diff --git a/recipes/aeolus/templates/vmware.json b/recipes/aeolus/templates/vmware.json
new file mode 100644
index 0000000..ec69d5e
--- /dev/null
+++ b/recipes/aeolus/templates/vmware.json
@@ -0,0 +1,10 @@
+{
+ "vsphere":
+ {
+ "api-url": "https://<%= vmware_api_endpoint %>/sdk",
+ "username": "<%= vmware_username %>",
+ "password": "<%= vmware_password %>",
+ "datastore": "<%= vmware_datastore %>",
+ "network_name": "<%= vmware_network_name %>"
+ }
+}
--
1.7.4.4
12 years, 9 months
[PATCH conductor] Make the deployment launch page prettier
by Tomas Sedovic
From: Tomas Sedovic <tsedovic(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=720426
Since the styling for the filter table widgets is not done yet, they're hidden
by default.
The filter_table helper has been modified to make it more configurable so that
it can be used for tables with no checkboxes.
---
src/app/helpers/application_helper.rb | 6 +++++-
src/app/stylesheets/custom.scss | 8 ++++++++
src/app/views/deployments/_new.haml | 27 +++++++++++++--------------
src/app/views/layouts/_filter_table.haml | 25 ++++++++++++++-----------
4 files changed, 40 insertions(+), 26 deletions(-)
diff --git a/src/app/helpers/application_helper.rb b/src/app/helpers/application_helper.rb
index 023e705..c6b3f73 100644
--- a/src/app/helpers/application_helper.rb
+++ b/src/app/helpers/application_helper.rb
@@ -116,6 +116,8 @@ module ApplicationHelper
def filter_table(columns, rows, options={}, &block)
_class = rows.first.try(:class) || Object
+ filter_widgets_opts = options[:show_filter_widgets]
+ select_togle_opts = options[:show_select_toggle]
render :partial => 'layouts/filter_table', :locals => {
# TODO - Right now saved_searches are not functional; this will need to be expanded
:form_header => options[:form_header] ? options[:form_header] : '',
@@ -127,7 +129,9 @@ module ApplicationHelper
:columns => columns,
:lower_class => _class.to_s.tableize,
:block => block,
- :rows => rows
+ :rows => rows,
+ :show_filter_widgets => filter_widgets_opts.nil? ? false : filter_widgets_opts,
+ :show_select_toggle => select_togle_opts.nil? ? true : select_togle_opts,
}
end
diff --git a/src/app/stylesheets/custom.scss b/src/app/stylesheets/custom.scss
index 67de91b..d6dab6a 100644
--- a/src/app/stylesheets/custom.scss
+++ b/src/app/stylesheets/custom.scss
@@ -59,3 +59,11 @@ footer.standard{
padding: 14px 14px 13px 14px;
}
}
+
+.deployable_details .content li {
+ list-style-type: none;
+}
+
+#deployable-xml-link {
+ color: #666;
+}
diff --git a/src/app/views/deployments/_new.haml b/src/app/views/deployments/_new.haml
index dbfffb8..8b36a9a 100644
--- a/src/app/views/deployments/_new.haml
+++ b/src/app/views/deployments/_new.haml
@@ -4,6 +4,13 @@
Deployment
= @deployment.name
#obj_actions.button-container
+ - form_for @deployment do
+ = hidden_field :deployment, :name
+ = hidden_field :deployment, :pool_id
+ = hidden_field :deployment, :frontend_realm_id
+ -# FIXME: Passing chunks of XML around in hidden form fields doesn't feel right
+ = hidden_field :deployment, :deployable_xml
+ = submit_tag 'Launch this deployment', :class => 'button primary', :id => 'launch_deployment'
= link_to 'Cancel', pool_path(@pool), :class => 'button danger', :id => 'cancel_deployment_button'
.corner
@@ -20,6 +27,7 @@
%dt deployable definition
%dd= link_to('view', '#', :id => 'deployable-xml-link')
+
%section.content-section.deployable_details
%header
%h2
@@ -35,18 +43,17 @@
Description:
= @deployment.deployable_xml.description
-%section.content-section.deployable_details
+%section.content-section.assemblies
%header
%h2
Assemblies
.content
- = filter_table([{:name => 'Assembly Name'},
- {:name => 'Hardware Profile'},
- {:name => 'Image ID'},
- {:name => 'Build ID'}],
- @deployment.deployable_xml.assemblies) do |assembly|
+ = filter_table([{:name => 'Assembly Name'}, {:name => 'Hardware Profile'},
+ {:name => 'Image ID'}, {:name => 'Build ID'}],
+ @deployment.deployable_xml.assemblies,
+ :show_select_toggle => false) do |assembly|
%tr
%td
= assembly.name
@@ -57,12 +64,4 @@
%td
= assembly.image_build
- - form_for @deployment do
- = hidden_field :deployment, :name
- = hidden_field :deployment, :pool_id
- = hidden_field :deployment, :frontend_realm_id
- -# FIXME: Passing chunks of XML around in hidden form fields doesn't feel right
- = hidden_field :deployment, :deployable_xml
- = submit_tag 'Launch', :class => 'button'
-
-# Quota checking to go here as well, once I understand how it works with new code
diff --git a/src/app/views/layouts/_filter_table.haml b/src/app/views/layouts/_filter_table.haml
index b2d6d1c..f4c885c 100644
--- a/src/app/views/layouts/_filter_table.haml
+++ b/src/app/views/layouts/_filter_table.haml
@@ -1,21 +1,24 @@
- form_tag do
- if form_header
= form_header
- %p
- Viewing
- = select_tag("select_#{lower_class}", saved_searches.join.html_safe,:disabled => true)
- = object_count.to_s + " results"
- = text_field_tag :q, search_term || "Search result for...", :disabled => true
- = link_to('Filters', '#')
- %p
- = link_to('Share this view', '#')
- = link_to('Add/Remove Columns', '#')
+ - if show_filter_widgets
+ %p
+ Viewing
+ = select_tag("select_#{lower_class}", saved_searches.join.html_safe,:disabled => true)
+ = object_count.to_s + " results"
+ = text_field_tag :q, search_term || "Search result for...", :disabled => true
+ = link_to('Filters', '#')
+ %p
+ = link_to('Share this view', '#')
+ = link_to('Add/Remove Columns', '#')
- = render :partial => 'layouts/select_all_none'
+ -if show_select_toggle
+ = render :partial => 'layouts/select_all_none'
%table.flat.checkbox_table
%thead
- %tr
+ -if show_filter_widgets or show_select_toggle
+ %tr
- columns.each do |column|
%th
= column[:name]
--
1.7.4.4
12 years, 9 months