[PATCH aggregator] Provider - add AJAX to edit
by jzigmund@redhat.com
From: Jozef Zigmund <jzigmund(a)redhat.com>
---
src/app/views/providers/_providers.haml | 16 ++++++++++++++++
src/app/views/providers/edit.haml | 2 +-
src/app/views/providers/show.haml | 2 +-
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/app/views/providers/_providers.haml b/src/app/views/providers/_providers.haml
index 5587a34..07b5e40 100644
--- a/src/app/views/providers/_providers.haml
+++ b/src/app/views/providers/_providers.haml
@@ -12,3 +12,19 @@
%input{ :type => 'submit', :value => t(:add), :disabled => ('disabled' unless controller.action_name == 'index') }
- form_tag({:controller => 'providers', :action => 'destroy', :id => @provider}, {:method => :delete , :class => 'buttononly'}) do
= submit_tag 'delete', :disabled => ('disabled' unless @provider and controller.action_name == 'show')
+
+:javascript
+ jQuery.ajaxSetup({ 'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}
+ })
+ $(document).ready( function () {
+ $("a.button").click(function (event) {
+ event.preventDefault()
+ if (!$(this).attr("disabled")) {
+ $.get(($(this).attr("href")), function (response) {
+ form = $(response).find('#edit_dcloud_form')
+ $("#show_dcloud").replaceWith(form)
+ $('a.button').attr('disabled', true)
+ });
+ }
+ })
+ })
diff --git a/src/app/views/providers/edit.haml b/src/app/views/providers/edit.haml
index 199a73a..2691bfa 100644
--- a/src/app/views/providers/edit.haml
+++ b/src/app/views/providers/edit.haml
@@ -2,6 +2,6 @@
#details.grid_13
%nav.subsubnav
= render_navigation(:level => 4)
- - form_for :provider, @provider, :url => provider_path(@provider), :html => { :method => 'put', :class => "dcloud_form" } do |f|
+ - form_for :provider, @provider, :url => provider_path(@provider), :html => { :id => 'edit_dcloud_form', :method => 'put', :class => "dcloud_form" } do |f|
= render :partial => 'form', :locals => { :f => f }
%input{ :type => 'submit', :value => t(:save), :name => 'save_provider', :id => 'save_provider' }
diff --git a/src/app/views/providers/show.haml b/src/app/views/providers/show.haml
index 574aed8..44c3612 100644
--- a/src/app/views/providers/show.haml
+++ b/src/app/views/providers/show.haml
@@ -3,7 +3,7 @@
%nav.subsubnav
= render_navigation(:level => 4)
%br
- %table
+ %table#show_dcloud
%thead
%tr
%th{:scope => "col"} Provider Name
--
1.7.2.3
13 years, 5 months
[PATCH aeolus 1/2] Redmine#11 - Update Links on Manage User Page
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
src/app/models/hardware_profile.rb | 5 ++++-
src/app/views/users/index.haml | 4 +++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/app/models/hardware_profile.rb b/src/app/models/hardware_profile.rb
index f6dead3..d5f66eb 100644
--- a/src/app/models/hardware_profile.rb
+++ b/src/app/models/hardware_profile.rb
@@ -21,7 +21,10 @@
class HardwareProfile < ActiveRecord::Base
has_many :instances
+
+ named_scope :frontend, :conditions => { :provider_id => nil }
named_scope :frontend, :conditions => { :provider_id => nil }
+
has_many :provider_instances, :class_name => "Instance",
:foreign_key => "provider_hardware_profile_id"
@@ -104,7 +107,7 @@ class HardwareProfile < ActiveRecord::Base
def self.matching_hwps(hwp)
matching_hwps = []
- provider_hwps = HardwareProfile.find_by_sql("SELECT * FROM hardware_profiles WHERE provider_id IS NOT NULL")
+ provider_hwps = HardwareProfile.all(:conditions => 'provider_id IS NOT NULL')
provider_hwps.each do |phwp|
if check_properties(hwp, phwp)
diff --git a/src/app/views/users/index.haml b/src/app/views/users/index.haml
index d0a5d7e..8ec3178 100644
--- a/src/app/views/users/index.haml
+++ b/src/app/views/users/index.haml
@@ -26,16 +26,18 @@
=link_to "Quota", users_url(:sort_by => "quota")
%span (Instances)
%th= link_to "e-mail", users_url(:sort_by => "email")
+ %th
-(a)users.each do |user|
%tr
%td
%input{:name => "user_checkbox", :type => "radio", :value => user.id, :id => "user_checkbox_#{user.id}" }
- %td= link_to user.login, {:action => "edit", :id => user.id}
+ %td= link_to user.login, user_path(user)
%td= user.last_name
%td= user.first_name
%td= sprintf("%.2f", user.quota.percentage_used)
%td= Quota.no_limit(user.quota.maximum_running_instances) ? "Unlimited" : user.quota.maximum_running_instances
%td= user.email
+ %td= link_to "edit", edit_user_path(user)
:javascript
$(document).ready(function () {
--
1.7.2.3
13 years, 5 months
Fwd: Announcing Free Monitoring for Amazon EC2 Instances
by marios@redhat.com
Amazon announce free monitoring for ec2
http://aws.amazon.com/about-aws/whats-new/2010/12/03/announcing-free-moni...
(original email below)
-------- Original Message --------
Subject: Announcing Free Monitoring for Amazon EC2 Instances
Date: Fri, 3 Dec 2010 09:16:18 +0000 (UTC)
From: Amazon Web Services <store-news(a)amazon.com>
To: marios.andreou(a)gmail.com <marios.andreou(a)gmail.com>
<http://www.amazon.com/gp/r.html?R=3RGJEOZ4AK1BM&C=36LNSD1RPU5G&H=19XDCAYG...>
Dear Amazon EC2 Customer,
We're excited to let you know that as of today, all Amazon EC2 instances
come with free Basic Monitoring metrics from our Monitoring service,
Amazon CloudWatch. You don't need to do anything to make this happen.
It's there for you to use. Simply sign in to the AWS Management Console
and select one of your active instances. You will immediately be able to
view graphs and track performance on metrics such as CPU utilization,
disk reads and writes, and network traffic.
Basic Monitoring for Amazon EC2 provides metric data on instance
performance at five-minute frequency. Customers can optionally choose to
enable Detailed Monitoring, which provides metric data at one-minute
frequency for an additional $0.015 per instance-hour.
In addition, starting today you can now set alarms for any metric that
Amazon CloudWatch monitors. You can configure these alarms via API call
to send notifications or initiate Auto Scaling actions when metrics
cross certain thresholds. Alarm pricing starts at $0.10 per alarm per month.
All the features mentioned above are available immediately in all
regions (US-N. Virginia, US-N. California, EU-Ireland, APAC-Singapore),
and we invite you to try them today! Learn more about Amazon CloudWatch
at: aws.amazon.com/cloudwatch
<http://www.amazon.com/gp/r.html?R=3RGJEOZ4AK1BM&C=36LNSD1RPU5G&H=TIFSV7DT...>.
Sincerely,
The Amazon Web Services Team
P.S. Amazon CloudWatch monitoring remains free of charge for Amazon EBS
volumes, Elastic Load Balancers, and Amazon RDS DB instances.
We hope you enjoyed receiving this message. If you wish to remove
yourself from receiving future product announcements or the AWS
Newsletter, please update your communication preferences
<http://www.amazon.com/gp/r.html?R=3RGJEOZ4AK1BM&C=36LNSD1RPU5G&H=ABVMQ0XW...>.
Amazon Web Services LLC is a subsidiary of Amazon.com, Inc. Amazon.com
is a registered trademark of Amazon.com, Inc. This message produced and
distributed by Amazon Web Services, LLC, 410 Terry Avenue North,
Seattle, WA 98109.
13 years, 5 months
[PATCH aeolus] Redmine#21 - Created function for calculating matching Backend (provider) HWP against Frontend (aeolus) HWP
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
src/app/models/hardware_profile.rb | 67 ++++++++
src/spec/factories/hardware_profile.rb | 1 +
src/spec/factories/hardware_profile_property.rb | 30 ++++
src/spec/factories/property_enum_entry.rb | 4 -
src/spec/models/hardware_profile_spec.rb | 186 +++++++++++++++++++++++
5 files changed, 284 insertions(+), 4 deletions(-)
diff --git a/src/app/models/hardware_profile.rb b/src/app/models/hardware_profile.rb
index efd34da..686bce8 100644
--- a/src/app/models/hardware_profile.rb
+++ b/src/app/models/hardware_profile.rb
@@ -101,4 +101,71 @@ class HardwareProfile < ActiveRecord::Base
end
the_property
end
+
+ def self.matching_hwps(hwp)
+ matching_hwps = []
+ provider_hwps = HardwareProfile.all(:conditions => 'provider_id IS NOT NULL')
+
+ provider_hwps.each do |phwp|
+ if check_properties(hwp, phwp)
+ matching_hwps << phwp
+ end
+ end
+ return matching_hwps
+ end
+
+ private
+ def self.check_properties(hwp1, hwp2)
+ check_hwp_property(hwp1.memory, hwp2.memory) &&
+ check_hwp_property(hwp1.cpu, hwp2.cpu) &&
+ check_hwp_property(hwp1.storage, hwp2.storage) &&
+ hwp1.architecture.value == hwp2.architecture.value
+ end
+
+ def self.check_hwp_property(p1, p2)
+ if p1.kind == 'range'
+ calculate_range_match(p1, p2)
+ elsif p2.kind == 'range'
+ calculate_range_match(p2, p1)
+ else
+ !(create_array_from_property(p1) & create_array_from_property(p2)).empty?
+ end
+ end
+
+ def self.calculate_range_match(p1, p2)
+ case p2.kind
+ when 'range'
+ if p1.range_first.to_f > p2.range_last.to_f || p1.range_last.to_f < p2.range_first.to_f
+ return false
+ end
+ return true
+
+ when 'enum'
+ p2.property_enum_entries.each do |enum|
+ if (p1.range_first.to_f..p1.range_last.to_f) === enum.value.to_f
+ return true
+ end
+ end
+ return false
+
+ when 'fixed'
+ return (p1.range_first.to_f..p1.range_last.to_f) === p2.value.to_f
+
+ end
+ end
+
+ def self.create_array_from_property(p)
+ case p.kind
+ when 'fixed'
+ return [p.value.to_f]
+
+ when 'enum'
+ values = []
+ p.property_enum_entries.each do |enum|
+ values << enum.value.to_f
+ end
+ return values
+
+ end
+ end
end
diff --git a/src/spec/factories/hardware_profile.rb b/src/spec/factories/hardware_profile.rb
index c4956df..432e679 100644
--- a/src/spec/factories/hardware_profile.rb
+++ b/src/spec/factories/hardware_profile.rb
@@ -1,5 +1,6 @@
Factory.define :hardware_profile do |p|
p.sequence(:name) { |n| "hardware_profile#{n}" }
+ p.sequence(:external_key) { |n| "hardware_profile_key#{n}" }
end
Factory.define :mock_hwp1, :parent => :hardware_profile do |p|
diff --git a/src/spec/factories/hardware_profile_property.rb b/src/spec/factories/hardware_profile_property.rb
index a64ab8a..94453ea 100644
--- a/src/spec/factories/hardware_profile_property.rb
+++ b/src/spec/factories/hardware_profile_property.rb
@@ -180,3 +180,33 @@ Factory.define :agg_hwp3_arch, :parent => :hardware_profile_property do |p|
p.unit 'label'
p.value 'i386'
end
+
+Factory.define :hwpp_range, :parent => :hardware_profile_property do |p|
+ p.name 'memory'
+ p.kind 'range'
+ p.unit 'MB'
+ p.range_first 256
+ p.range_last 512
+ p.value 256
+end
+
+Factory.define :hwpp_fixed, :parent => :hardware_profile_property do |p|
+ p.name 'memory'
+ p.kind 'fixed'
+ p.unit 'MB'
+ p.value 256
+end
+
+Factory.define :hwpp_enum, :parent => :hardware_profile_property do |p|
+ p.name 'memory'
+ p.kind 'enum'
+ p.unit 'MB'
+ p.value 256
+end
+
+Factory.define :hwpp_arch, :parent => :hardware_profile_property do |p|
+ p.name 'architecture'
+ p.kind 'fixed'
+ p.unit 'label'
+ p.value 'i386'
+end
\ No newline at end of file
diff --git a/src/spec/factories/property_enum_entry.rb b/src/spec/factories/property_enum_entry.rb
index 78b99d5..6589f45 100644
--- a/src/spec/factories/property_enum_entry.rb
+++ b/src/spec/factories/property_enum_entry.rb
@@ -3,24 +3,20 @@ end
Factory.define :mock_hwp2_storage_enum1, :parent => :property_enum_entry do |e|
e.value 850
- e.prop_name 'storage'
e.hardware_profile_property { |e| e.association(:mock_hwp2_storage) }
end
Factory.define :mock_hwp2_storage_enum2, :parent => :property_enum_entry do |e|
e.value 1024
- e.prop_name 'storage'
e.hardware_profile_property { |e| e.association(:mock_hwp2_storage) }
end
Factory.define :agg_hwp2_storage_enum1, :parent => :property_enum_entry do |e|
e.value 850
- e.prop_name 'storage'
e.hardware_profile_property { |e| e.association(:agg_hwp2_storage) }
end
Factory.define :agg_hwp2_storage_enum2, :parent => :property_enum_entry do |e|
e.value 1024
- e.prop_name 'storage'
e.hardware_profile_property { |e| e.association(:agg_hwp2_storage) }
end
diff --git a/src/spec/models/hardware_profile_spec.rb b/src/spec/models/hardware_profile_spec.rb
index bf806e3..bc755f1 100644
--- a/src/spec/models/hardware_profile_spec.rb
+++ b/src/spec/models/hardware_profile_spec.rb
@@ -85,4 +85,190 @@ describe HardwareProfile do
@hp.memory =(a)hp.new_property(api_prop)
@hp.memory.kind.should equal((a)hp.memory.kind.to_s)
end
+
+ it "should calculate all the correct matches of provider hardware profiles against a given hardware profile" do
+ provider = Factory(:mock_provider)
+
+ # hwpp memory
+ hwpp_mem_match_all = Factory(:hwpp_range, :name => 'memory', :unit => 'MB', :range_first => 1, :range_last => 4096, :value => 256)
+ hwpp_mem_match_none = Factory(:hwpp_fixed, :name => 'memory', :unit => 'MB', :value => 8192)
+ hwpp_mem_match_2 = create_hwpp_enum([256, 1024], {:name => 'memory', :unit => 'MB'})
+
+ hwpp_mem_range = Factory(:hwpp_range, :name => 'memory', :unit => 'MB', :range_first => 256, :range_last => 512, :value => 256)
+ hwpp_mem_fixed = Factory(:hwpp_fixed, :name => 'memory', :unit => 'MB', :value => 4096)
+ hwpp_mem_enum = create_hwpp_enum([1024, 3072, 4096], {:name => 'memory', :unit => 'MB'})
+
+ # hwpp cpu
+ hwpp_cpu_match_all = Factory(:hwpp_range, :name => 'cpu', :unit => 'count', :range_first => 1, :range_last => 32, :value => 2)
+ hwpp_cpu_match_none = Factory(:hwpp_fixed, :name => 'cpu', :unit => 'count', :value => 64)
+ hwpp_cpu_match_2 = create_hwpp_enum([8, 16], {:name => 'cpu', :unit => 'count'})
+
+ hwpp_cpu_range = Factory(:hwpp_range, :name => 'cpu', :unit => 'count', :range_first => 1, :range_last => 16, :value => 4)
+ hwpp_cpu_fixed = Factory(:hwpp_fixed, :name => 'cpu', :unit => 'count', :value => 32)
+ hwpp_cpu_enum = create_hwpp_enum([16, 32], {:name => 'cpu', :unit => 'count'})
+
+ # hwpp storage
+ hwpp_storage_match_all = Factory(:hwpp_range, :name => 'storage', :unit => 'GB', :range_first => 100, :range_last => 4000, :value => 250)
+ hwpp_storage_match_none = Factory(:hwpp_fixed, :name => 'storage', :unit => 'GB', :value => 4000)
+ hwpp_storage_match_2 = create_hwpp_enum([1000, 2000], {:name => 'storage', :unit => 'GB'})
+
+ hwpp_storage_range = Factory(:hwpp_range, :name => 'storage', :unit => 'GB', :range_first => 100, :range_last => 1000, :value => 250)
+ hwpp_storage_fixed = Factory(:hwpp_fixed, :name => 'storage', :unit => 'GB', :value => 3000)
+ hwpp_storage_enum = create_hwpp_enum([2000, 4000], {:name => 'storage', :unit => 'GB'})
+
+ # hwpp arch
+ hwpp_arch_i386 = Factory(:hwpp_arch, :value => 'i386')
+
+ hwp_match_all = Factory(:hardware_profile, :memory => hwpp_mem_match_all,
+ :cpu => hwpp_cpu_match_all,
+ :storage => hwpp_storage_match_all,
+ :architecture => hwpp_arch_i386)
+
+ hwp_match_none = Factory(:hardware_profile, :memory => hwpp_mem_match_none,
+ :cpu => hwpp_cpu_match_none,
+ :storage => hwpp_storage_match_none,
+ :architecture => hwpp_arch_i386)
+
+ hwp_match_2 = Factory(:hardware_profile, :memory => hwpp_mem_match_2,
+ :cpu => hwpp_cpu_match_2,
+ :storage => hwpp_storage_match_2,
+ :architecture => hwpp_arch_i386)
+
+ hwp1 = Factory(:hardware_profile, :memory => hwpp_mem_range,
+ :cpu => hwpp_cpu_range,
+ :storage => hwpp_storage_range,
+ :architecture => hwpp_arch_i386,
+ :provider => provider)
+
+ hwp2 = Factory(:hardware_profile, :memory => hwpp_mem_fixed,
+ :cpu => hwpp_cpu_fixed,
+ :storage => hwpp_storage_fixed,
+ :architecture => hwpp_arch_i386,
+ :provider => provider)
+
+ hwp3 = Factory(:hardware_profile, :memory => hwpp_mem_enum,
+ :cpu => hwpp_cpu_enum,
+ :storage => hwpp_storage_enum,
+ :architecture => hwpp_arch_i386,
+ :provider => provider)
+
+ hwps = [hwp1, hwp2, hwp3]
+ (HardwareProfile.matching_hwps(hwp_match_all) & hwps).should == hwps
+ (HardwareProfile.matching_hwps(hwp_match_none) & hwps).should == []
+ (HardwareProfile.matching_hwps(hwp_match_2) & hwps).should == [hwp1, hwp3]
+ end
+
+ it "should calculate the correct array for hardware profile properties of kind: 'fixed' and 'enum'" do
+ hwp_fixed = Factory(:hwpp_fixed, :value => 256)
+
+ enum_array = [256.0, 512.0, 1024.0, 2048.0]
+ hwp_enum = create_hwpp_enum(enum_array)
+
+ HardwareProfile.create_array_from_property(hwp_fixed).should == [256.0]
+ (HardwareProfile.create_array_from_property(hwp_enum) & enum_array).should == enum_array
+ end
+
+ it "should determine match for 2 hardware profiles" do
+ hwpp_mem_range = Factory(:hwpp_range, :name => 'memory', :unit => 'MB', :range_first => 256, :range_last => 512, :value => 256)
+ hwpp_mem_fixed = Factory(:hwpp_fixed, :name => 'memory', :unit => 'MB', :value => 1024)
+ hwpp_mem_enum = create_hwpp_enum([2048, 3072, 4096], {:name => 'memory', :unit => 'MB'})
+
+ hwpp_cpu_range = Factory(:hwpp_range, :name => 'cpu', :unit => 'count', :range_first => 1, :range_last => 4, :value => 2)
+ hwpp_cpu_fixed = Factory(:hwpp_fixed, :name => 'cpu', :unit => 'count', :value => 8)
+ hwpp_cpu_enum = create_hwpp_enum([16, 32], {:name => 'cpu', :unit => 'count'})
+
+ hwpp_storage_range = Factory(:hwpp_range, :name => 'storage', :unit => 'GB', :range_first => 100, :range_last => 500, :value => 250)
+ hwpp_storage_fixed = Factory(:hwpp_fixed, :name => 'storage', :unit => 'GB', :value => 1000)
+ hwpp_storage_enum = create_hwpp_enum([2000, 4000], {:name => 'storage', :unit => 'GB'})
+
+ hwpp_arch_i386 = Factory(:hwpp_arch, :value => 'i386')
+ hwpp_arch_x86_64 = Factory(:hwpp_arch, :value => 'x86_64')
+
+ hwp1 = Factory(:hardware_profile, :memory => hwpp_mem_range, :cpu => hwpp_cpu_range, :storage => hwpp_storage_range, :architecture => hwpp_arch_i386)
+ hwp2 = Factory(:hardware_profile, :memory => hwpp_mem_fixed, :cpu => hwpp_cpu_fixed, :storage => hwpp_storage_fixed, :architecture => hwpp_arch_i386)
+ hwp3 = Factory(:hardware_profile, :memory => hwpp_mem_enum, :cpu => hwpp_cpu_enum, :storage => hwpp_storage_enum, :architecture => hwpp_arch_i386)
+ hwp4 = Factory(:hardware_profile, :memory => hwpp_mem_enum, :cpu => hwpp_cpu_enum, :storage => hwpp_storage_enum, :architecture => hwpp_arch_x86_64)
+
+ HardwareProfile.check_properties(hwp1, hwp1).should == true
+ HardwareProfile.check_properties(hwp2, hwp2).should == true
+ HardwareProfile.check_properties(hwp3, hwp3).should == true
+
+ HardwareProfile.check_properties(hwp1, hwp2).should == false
+ HardwareProfile.check_properties(hwp2, hwp3).should == false
+ HardwareProfile.check_properties(hwp3, hwp4).should == false
+ end
+
+ it "should calculate matches for range on hardware profile properties" do
+ hwp_range = Factory(:hwpp_range, :range_first => 256, :range_last => 512, :value => 256)
+
+ hwp_range_match = Factory(:hwpp_range, :range_first => 512, :range_last => 1024, :value => 512)
+ hwp_range_fail = Factory(:hwpp_range, :range_first => 2048, :range_last => 2048, :value => 8192)
+
+ hwp_fixed_match = Factory(:hwpp_fixed, :value => 256)
+ hwp_fixed_fail = Factory(:hwpp_fixed, :value => 4096)
+
+ hwp_enum_match = create_hwpp_enum([256, 512, 1024, 2048])
+ hwp_enum_fail = create_hwpp_enum([2048, 4096, 8192, 16384])
+
+ [hwp_range_match, hwp_fixed_match, hwp_enum_match].each do |hwpp|
+ HardwareProfile.calculate_range_match(hwp_range, hwpp).should == true
+ end
+
+ [hwp_range_fail, hwp_fixed_fail, hwp_enum_fail].each do |hwpp|
+ HardwareProfile.calculate_range_match(hwp_range, hwpp).should == false
+ end
+ end
+
+ it "should calculate correct matches for each hwp property" do
+ hwp_range1 = Factory(:hwpp_range, :range_first => 256, :range_last => 512, :value => 512)
+ hwp_range2 = Factory(:hwpp_range, :range_first => 512, :range_last => 1024, :value => 768)
+ hwp_range3 = Factory(:hwpp_range, :range_first => 2048, :range_last => 4096, :value => 3072)
+
+ hwp_fixed1 = Factory(:hwpp_fixed, :value => 256)
+ hwp_fixed2 = Factory(:hwpp_fixed, :value => 4096)
+ hwp_fixed3 = Factory(:hwpp_fixed, :value => 8192)
+
+ hwp_enum1 = create_hwpp_enum([256, 512, 1024])
+ hwp_enum2 = create_hwpp_enum([1024, 2048, 3072])
+ hwp_enum3 = create_hwpp_enum([8192, 16384, 32768])
+
+ # Test HWPP Againsts Ranges
+ HardwareProfile.check_hwp_property(hwp_range1, hwp_range2).should == true
+ HardwareProfile.check_hwp_property(hwp_range1, hwp_range3).should == false
+
+ HardwareProfile.check_hwp_property(hwp_range1, hwp_fixed1).should == true
+ HardwareProfile.check_hwp_property(hwp_range1, hwp_fixed3).should == false
+
+ HardwareProfile.check_hwp_property(hwp_range1, hwp_enum1).should == true
+ HardwareProfile.check_hwp_property(hwp_range1, hwp_enum3).should == false
+
+ # Test HWPP Against Fixed
+ HardwareProfile.check_hwp_property(hwp_fixed1, hwp_range1).should == true
+ HardwareProfile.check_hwp_property(hwp_fixed1, hwp_range3).should == false
+
+ HardwareProfile.check_hwp_property(hwp_fixed1, hwp_fixed1).should == true
+ HardwareProfile.check_hwp_property(hwp_fixed1, hwp_fixed2).should == false
+
+ HardwareProfile.check_hwp_property(hwp_fixed1, hwp_enum1).should == true
+ HardwareProfile.check_hwp_property(hwp_fixed1, hwp_enum3).should == false
+
+ # Test HWPP Aginsts Enums
+ HardwareProfile.check_hwp_property(hwp_enum1, hwp_range1).should == true
+ HardwareProfile.check_hwp_property(hwp_enum1, hwp_range3).should == false
+
+ HardwareProfile.check_hwp_property(hwp_enum1, hwp_fixed1).should == true
+ HardwareProfile.check_hwp_property(hwp_enum1, hwp_fixed2).should == false
+
+ HardwareProfile.check_hwp_property(hwp_enum1, hwp_enum2).should == true
+ HardwareProfile.check_hwp_property(hwp_enum1, hwp_enum3).should == false
+ end
+
+ def create_hwpp_enum(value_array, properties = {})
+ hwpp_enum = Factory(:hwpp_enum, properties)
+ value_array.each do |value|
+ hwpp_enum.property_enum_entries << Factory(:property_enum_entry, :value => value, :hardware_profile_property => hwpp_enum)
+ end
+ return hwpp_enum
+ end
+
end
--
1.7.2.3
13 years, 5 months
[VOTE] deltacloud git branch changes
by Mo Morsi
A few of us were discussing possible changes to our git strategy today
and figure we'd ask around for additional feedback and ideas.
Currently our 'master' branch is viewed as pristine, we never touch it
until we have a release, at which point we merge our changes from our
development head 'next' or other special topic branches into it. This is
how the upstream git community manages their repository, though they are
the only other ones using this strategy that I know of. Their approach
seems to be different than ours though as their master and next branches
primarily consist of merge commits from others
https://github.com/git/git/commits/
https://github.com/git/git/commits/next
Many other git based projects use master as the primary development
head, tagging various releases as they are ready, and branching only
when a separate development track is necessary. For example, the ruby
upstream community develops against master (technically against the
'trunk' head in a svn repo which their git 'master' is a mirror of) with
branches for 1.8.7 and 1.9.1 development.
One of the benefits of doing it this way is that when developers
checkout the master branch (as would happen by default when one does a
git clone), they automatically have the latest development HEAD and do
not have to worry about or remember to switch branches before being able
to start development (though in practice its a good idea to create a new
local branch for any new changes).
Several of us wanted to change our git strategy to be more aligned with
this approach that many other projects make use of as well, but figure
it'd be best put up for a vote, so that any others with opinions
regarding this could have a say. If you're interested, please response
with a (+/-)1 and any thoughts.
Thanks alot,
-Mo
13 years, 5 months
Re: [deltacloud-devel] [VOTE] deltacloud git branch changes
by Tomas Sedovic
+1
I like the idea of `master` being the active branch more.
----- "Mohammed Morsi" <mmorsi(a)redhat.com> wrote:
> A few of us were discussing possible changes to our git strategy today
>
> and figure we'd ask around for additional feedback and ideas.
>
> Currently our 'master' branch is viewed as pristine, we never touch it
>
> until we have a release, at which point we merge our changes from our
>
> development head 'next' or other special topic branches into it. This
> is
> how the upstream git community manages their repository, though they
> are
> the only other ones using this strategy that I know of. Their approach
>
> seems to be different than ours though as their master and next
> branches
> primarily consist of merge commits from others
>
> https://github.com/git/git/commits/
> https://github.com/git/git/commits/next
>
> Many other git based projects use master as the primary development
> head, tagging various releases as they are ready, and branching only
> when a separate development track is necessary. For example, the ruby
>
> upstream community develops against master (technically against the
> 'trunk' head in a svn repo which their git 'master' is a mirror of)
> with
> branches for 1.8.7 and 1.9.1 development.
>
> One of the benefits of doing it this way is that when developers
> checkout the master branch (as would happen by default when one does a
>
> git clone), they automatically have the latest development HEAD and do
>
> not have to worry about or remember to switch branches before being
> able
> to start development (though in practice its a good idea to create a
> new
> local branch for any new changes).
>
> Several of us wanted to change our git strategy to be more aligned
> with
> this approach that many other projects make use of as well, but figure
>
> it'd be best put up for a vote, so that any others with opinions
> regarding this could have a say. If you're interested, please response
>
> with a (+/-)1 and any thoughts.
>
> Thanks alot,
> -Mo
> _______________________________________________
> deltacloud-devel mailing list
> deltacloud-devel(a)lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/deltacloud-devel
13 years, 5 months
Image import
by Jan Provazník
This patch depends on 'Factory UI cleanup and multiple providers' patchset.
13 years, 5 months
[PATCH aeolus] Fix nav colour in the Provider Accounts navigation
by Tomas Sedovic
From: Tomas Sedovic <tsedovic(a)redhat.com>
The submenu navigation stripe in the Provider Accounts page should have the
same greenish colour that other admin screens have.
---
src/app/controllers/cloud_accounts_controller.rb | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/app/controllers/cloud_accounts_controller.rb b/src/app/controllers/cloud_accounts_controller.rb
index 38af463..ae0a224 100644
--- a/src/app/controllers/cloud_accounts_controller.rb
+++ b/src/app/controllers/cloud_accounts_controller.rb
@@ -25,6 +25,10 @@ class CloudAccountsController < ApplicationController
helper :providers
+ def section_id
+ 'administration'
+ end
+
def index
@provider = Provider.find(params[:provider_id])
require_privilege(Privilege::ACCOUNT_VIEW, @provider)
--
1.7.3.2
13 years, 5 months