[PATCH aggregator] Converts HardwareProfileProperty 'kind' attr to string.
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
Deltacloud client lib returns 'kind' attribute as a symbol,
but activereord doesn't deal well with it when saving. This
patch stringifies value.
---
src/app/models/hardware_profile.rb | 4 ++--
src/app/models/hardware_profile_property.rb | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/app/models/hardware_profile.rb b/src/app/models/hardware_profile.rb
index de9ef23..2ce6d81 100644
--- a/src/app/models/hardware_profile.rb
+++ b/src/app/models/hardware_profile.rb
@@ -85,10 +85,10 @@ class HardwareProfile < ActiveRecord::Base
def new_property(prop)
return nil unless prop.present?
the_property = HardwareProfileProperty.new(:name => prop.name,
- :kind => prop.kind,
+ :kind => prop.kind.to_s,
:unit => prop.unit,
:value => prop.value)
- case prop.kind
+ case prop.kind.to_s
when HardwareProfileProperty::RANGE
the_property.range_first = prop.range[:from]
the_property.range_last = prop.range[:to]
diff --git a/src/app/models/hardware_profile_property.rb b/src/app/models/hardware_profile_property.rb
index 0717484..1291122 100644
--- a/src/app/models/hardware_profile_property.rb
+++ b/src/app/models/hardware_profile_property.rb
@@ -26,9 +26,9 @@ class HardwareProfileProperty < ActiveRecord::Base
CPU = "cpu"
ARCHITECTURE = "architecture"
- FIXED = :fixed
- RANGE = :range
- ENUM = :enum
+ FIXED = 'fixed'
+ RANGE = 'range'
+ ENUM = 'enum'
UNIT_MB = "MB"
UNIT_GB = "GB"
--
1.7.0.1
13 years, 8 months
[PATCH aggregator] Removed "Add a Provider Account" link from Summary dashboard tab.
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
Referenced page raises exception because of missing provider_id and we don't know
provider on summary page. Provider account creation is still accessible from
provider page.
---
src/app/views/dashboard/summary.haml | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/src/app/views/dashboard/summary.haml b/src/app/views/dashboard/summary.haml
index f3a21d3..ff116d4 100644
--- a/src/app/views/dashboard/summary.haml
+++ b/src/app/views/dashboard/summary.haml
@@ -31,8 +31,6 @@
%h2
Actions
- if @is_admin
- %a{:href => url_for(:controller => "cloud_accounts", :action => "new")}
- Add a Provider Account
%a{:href => url_for(:controller => "provider", :action => "new")}
Add a Provider
%a{:href => url_for(:controller => "users", :action => "new")}
--
1.7.0.1
13 years, 8 months
[PATCH docs] Add anchors for the headings at the Download page.
by Tomas Sedovic
From: Tomas Sedovic <tsedovic(a)redhat.com>
This allows us to link to a particular tool (if it doesn't have any other
web presence).
---
deltacloud.org/content/download.mdown | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/deltacloud.org/content/download.mdown b/deltacloud.org/content/download.mdown
index ad8757d..26db1c3 100644
--- a/deltacloud.org/content/download.mdown
+++ b/deltacloud.org/content/download.mdown
@@ -5,7 +5,7 @@ filter: markdown
---
Download
========
-### Deltacloud Core ###
+<h3 id="deltacloud-core">Deltacloud Core</h3>
Deltacloud Core provides the API server and drivers necessary for connecting
to the cloud providers.
@@ -17,7 +17,7 @@ following command:
We plan to release RPM version for Fedora soon.
-### Deltacloud Aggregator ###
+<h3 id="deltacloud-aggregator">Deltacloud Aggregator</h3>
Deltacloud Aggregator provides a web-based user interface for managing your
cloud instances.
@@ -31,7 +31,7 @@ Additional Tools
----------------
These are complementary to the essential Core/Aggregator components.
-### libdeltacloud ###
+<h3 id="libdeltacloud">libdeltacloud</h3>
A library for accessing the Deltacloud API from C/C++ programs.
@@ -46,7 +46,7 @@ Or you can download the RPMs for Fedora 12 and 13:
Contributed by Chris Lalancette.
-### Deltacloud Client ###
+<h3 id="deltacloud-client">Deltacloud Client</h3>
Deltacloud Client is a command line tool that communicates with the
Deltacloud API.
@@ -55,7 +55,7 @@ Type the following command to install it:
$ gem install deltacloud-core
-### Deltacloud driver for VirtualBox ###
+<h3 id="virtualbox-driver">Deltacloud driver for VirtualBox</h3>
<http://gitorious.org/deltacloud-devel/deltacloud-virtualbox-driver>
--
1.7.1.1
13 years, 9 months
[PATCH aggregator] test and spec fixes
by Mo Morsi
---
src/spec/controllers/users_controller_spec.rb | 4 ++--
src/spec/spec_helper.rb | 4 ++--
src/test/fixtures/users.yml | 5 +++++
.../functional/user_sessions_controller_test.rb | 2 +-
src/test/functional/users_controller_test.rb | 5 +++--
src/test/unit/provider_test.rb | 8 ++++----
6 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/spec/controllers/users_controller_spec.rb b/src/spec/controllers/users_controller_spec.rb
index 231a533..bdb5604 100644
--- a/src/spec/controllers/users_controller_spec.rb
+++ b/src/spec/controllers/users_controller_spec.rb
@@ -38,7 +38,7 @@ describe UsersController do
|perm| perm.role.name.eql?('Instance Creator and User')
}.should be_true
id = User.find(:first, :conditions => ['login = ?', "tuser2"]).id
- response.should redirect_to("http://test.host/users/show/#{id}")
+ response.should redirect_to("http://test.host/users/#{id}")
end
it "fails to create pool" do
@@ -70,7 +70,7 @@ describe UsersController do
:password_confirmation => "testpass" }
}.should change{ User.count }
id = User.find(:first, :conditions => ['login = ?', "tuser3"]).id
- response.should redirect_to("http://test.host/users/show/#{id}")
+ response.should redirect_to("http://test.host/users/#{id}")
end
it "should not allow a regular user to create user" do
diff --git a/src/spec/spec_helper.rb b/src/spec/spec_helper.rb
index 4a72e06..ea87cdb 100644
--- a/src/spec/spec_helper.rb
+++ b/src/spec/spec_helper.rb
@@ -13,8 +13,8 @@ require 'authlogic/test_case'
# in ./support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
-# factories are not loaded automatically (at least with rspec 1.3.0 on Fedora 13)
-Dir[File.expand_path(File.join(File.dirname(__FILE__),'factories','**','*.rb'))].each {|f| puts f;require f}
+# factories are not loaded automatically (at least with rspec 1.3.0 on Fedora 13) (yes they are)
+#Dir[File.expand_path(File.join(File.dirname(__FILE__),'factories','**','*.rb'))].each {|f| puts f;require f}
Spec::Runner.configure do |config|
# If you're not using ActiveRecord you should remove these
diff --git a/src/test/fixtures/users.yml b/src/test/fixtures/users.yml
index d51db27..f523201 100644
--- a/src/test/fixtures/users.yml
+++ b/src/test/fixtures/users.yml
@@ -2,14 +2,19 @@
test_user:
login: tuser
+ first_name: test
+ last_name: user
email: tuser(a)example.com
password_salt: <%= salt = Authlogic::Random.hex_token %>
crypted_password: <%= Authlogic::CryptoProviders::Sha512.encrypt("testpass" + salt) %>
persistence_token: 5136b29cb04a5b8840fe74451b8bdf83531f57c072826eaf63a5c05e71828ed58fc5359a2f22b02e54298d64e043a870bc03d898249dd7f577f6c5418d5ba5a6
single_access_token: YxaPK0smnUj2t9Pq0xuK
perishable_token: XZO-3xU2OIqHAUJOkDMX
+
test_admin:
login: tadmin
+ first_name: test
+ last_name: admin
email: tadmin(a)example.com
password_salt: <%= salt = Authlogic::Random.hex_token %>
crypted_password: <%= Authlogic::CryptoProviders::Sha512.encrypt("testpass" + salt) %>
diff --git a/src/test/functional/user_sessions_controller_test.rb b/src/test/functional/user_sessions_controller_test.rb
index fae1757..21d63a8 100644
--- a/src/test/functional/user_sessions_controller_test.rb
+++ b/src/test/functional/user_sessions_controller_test.rb
@@ -11,7 +11,7 @@ class UserSessionsControllerTest < ActionController::TestCase
post :create, :user_session => { :login => "tuser", :password => "testpass" }
assert user_session = UserSession.find
assert_equal users(:test_user), user_session.user
- assert_redirected_to account_path
+ assert_redirected_to dashboard_url
end
test "should destroy user session" do
diff --git a/src/test/functional/users_controller_test.rb b/src/test/functional/users_controller_test.rb
index 0f04dd2..9691e8b 100644
--- a/src/test/functional/users_controller_test.rb
+++ b/src/test/functional/users_controller_test.rb
@@ -1,7 +1,7 @@
require 'test_helper'
class UsersControllerTest < ActionController::TestCase
- fixtures :users
+ fixtures :base_permission_objects, :users, :roles
test "should get new" do
get :new
@@ -15,7 +15,8 @@ class UsersControllerTest < ActionController::TestCase
:password_confirmation => "testpass" }
end
- assert_redirected_to account_path
+ id = User.find(:first, :conditions => ['login = ?', "tuser2"]).id
+ assert_redirected_to "http://test.host/users/#{id}"
end
test "should show user" do
diff --git a/src/test/unit/provider_test.rb b/src/test/unit/provider_test.rb
index 877fd9c..f56f8a4 100644
--- a/src/test/unit/provider_test.rb
+++ b/src/test/unit/provider_test.rb
@@ -8,10 +8,10 @@ class ProviderTest < ActiveSupport::TestCase
:cloud_type => "EC2")
end
# The following three tests assume you have the deltacloud-framework
- # running and configured on localhost:3000
+ # running and configured on localhost:3001
test "is valid with good url" do
- @provider.url = "http://localhost:3000/api"
+ @provider.url = "http://localhost:3001/api"
flunk "That URL should have worked. Is framework running?" if @provider.invalid?
end
@@ -29,7 +29,7 @@ class ProviderTest < ActiveSupport::TestCase
end
test "should return DeltaCloud if successful connection" do
- @provider.url = "http://localhost:3000/api"
- assert_instance_of(DeltaCloud, @provider.connect)
+ @provider.url = "http://localhost:3001/api"
+ assert_instance_of(DeltaCloud::API, @provider.connect)
end
end
--
1.7.1.1
13 years, 9 months
[PATCH aggregator] Fix tests broken by UI changes.
by Jason Guiditta
This was my fault, forgot to run 'rake cucumber'
before ACKing change that removed sidebar from
most pages.
---
src/features/pool.feature | 8 ++++----
src/features/support/paths.rb | 3 +++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/features/pool.feature b/src/features/pool.feature
index 9e27499..4d563c8 100644
--- a/src/features/pool.feature
+++ b/src/features/pool.feature
@@ -8,7 +8,7 @@ Feature: Manage Pools
And I am logged in
Scenario: Create a new Pool
- Given I am on the homepage
+ Given I am on the instances page
And there is not a pool named "mockpool"
When I follow "Add a pool"
Then I should be on the new pool page
@@ -27,7 +27,7 @@ Feature: Manage Pools
| m1-small | 1740 | 2 | 160.0 | i386 |
| m1-large | 4096 | 4 | 850.0 | x86_64 |
| m1-xlarge | 8192 | 8 | 1690.0 | x86_64 |
- And I am on the homepage
+ And I am on the instances page
When I follow "mockpool"
Then I should be on the show pool page
When I follow "Hardware Profiles"
@@ -39,7 +39,7 @@ Feature: Manage Pools
Scenario: View Pool's Realms
Given I own a pool named "mockpool"
And the Pool has the following Realms named "Europe, United States"
- And I am on the homepage
+ And I am on the instances page
When I follow "mockpool"
Then I should be on the show pool page
When I follow "Realms"
@@ -61,7 +61,7 @@ Feature: Manage Pools
| running_cpus | 16 |
| total_instances | 15 |
| total_storage | 8400 |
- And I am on the homepage
+ And I am on the instances page
When I follow "mockpool"
Then I should be on the show pool page
When I follow "Quota"
diff --git a/src/features/support/paths.rb b/src/features/support/paths.rb
index 1f9a8a3..db20948 100644
--- a/src/features/support/paths.rb
+++ b/src/features/support/paths.rb
@@ -44,6 +44,9 @@ module NavigationHelpers
when /the dashboard page/
dashboard_path
+ when /the instances page/
+ instance_path
+
when /the pool hardware profiles page/
hardware_profiles_pool_path
--
1.7.1.1
13 years, 9 months
JavaClient Update
by Martyn Taylor
Guys,
The JavaClient has now been updated for support with the latest version of the API.
The project source can be found here: http://github.com/mtaylor/deltacloud-tools
Includes build instructions and simple examples to get up and running.
Major changes include:
* Requires New Depenedency: JDOM see: http://www.jdom.org/
* Change Package name to: org.deltacloud
* Move from Flavors to HardwareProfiles.
* Change to API methods reboot, stop, etc... Replace with the "performInstanceAction" method
* Updated HardwareProfile contents to use Properties, Enums, Params, Range.
* Updated Objects to Map to DC NameSpace, using Custom XML Schema. (To allow smoother update process).
* Added JDOM NameSpace injection to API Response for JAXB Mappings.
Cheers,
Martyn
13 years, 9 months