[PATCH core] Core: Add 'public_key' feature for :keys collection

2013-04-04 Thread mfojtik
From: Michal Fojtik This feature indicate wheter cloud provider support uploading of custom PEM keys or not. Signed-off-by: Michal fojtik --- server/lib/deltacloud/collections/keys.rb | 1 - server/lib/deltacloud/drivers/digitalocean/digitalocean_driver.rb | 1 + server

[PATCH core] Core: Added url_for helpers for Rabbit subcollections (DTACLOUD-526)

2013-04-04 Thread mfojtik
From: Michal Fojtik This patch add URL helpers for all Rabbit subcollections, like: system_volumes(:id => system_id) => "http://localhost:3001/cimi/systems/system_id/volumes"; system_volumes(:id => system_id, :ent_id => volume_id) => "http://localhost:3001/cimi/systems/system_id/volumes/volum

[PATCH core 3/5] Client: Added #url method to all client objects

2013-04-03 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- client/lib/deltacloud/client/models/base.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/lib/deltacloud/client/models/base.rb b/client/lib/deltacloud/client/models/base.rb index dbf34f7..cfdab5d 100644 --- a/client/lib/delta

[PATCH core 1/5] Client: Added base64#encode for user_data (DTACLOUD-522)

2013-04-03 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- client/lib/deltacloud/client.rb | 1 + client/lib/deltacloud/client/methods/instance.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/client/lib/deltacloud/client.rb b/client/lib/deltacloud/client.rb index c7048dd..7

[PATCH core 5/5] Client: Added #actions and #create_image for Instance

2013-04-03 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- client/lib/deltacloud/client/models/instance.rb | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/client/lib/deltacloud/client/models/instance.rb b/client/lib/deltacloud/client/models/instance.rb index 01e188

[PATCH core 2/5] Client: Make possible to retrieve attrs from InstanceAddress (DTACLOUD-522)

2013-04-03 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- .../lib/deltacloud/client/models/instance_address.rb | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/client/lib/deltacloud/client/models/instance_address.rb b/client/lib/deltacloud/client/models/ins

[PATCH core 4/5] Client: Updated tests for #url and InstanceAddress (DTACLOUD-523)

2013-04-03 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- client/tests/methods/instance_test.rb | 6 ++ client/tests/models/image_test.rb | 2 ++ 2 files changed, 8 insertions(+) diff --git a/client/tests/methods/instance_test.rb b/client/tests/methods/instance_test.rb index 47b3934..4abe

[PATCH core 1/2] CIMI: Added 'generate_XXX_route' helpers for CIMI

2013-03-27 Thread mfojtik
From: Michal Fojtik All CIMI entities share the same code in Rabbit operations. These helpers should merge them all to avoid code duplication. Signed-off-by: Michal fojtik --- server/lib/cimi/helpers/cimi_rabbit_helper.rb | 59 +++ 1 file changed, 59 insertions(+) crea

[PATCH core 2/2] CIMI: Revamp all collections to use generated operations (where possible)

2013-03-27 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/collections/address_templates.rb | 46 ++- server/lib/cimi/collections/addresses.rb | 48 +++- server/lib/cimi/collections/base.rb| 6 ++- server/lib/cimi/collectio

[PATCH core 1/2] CIMI: Fixed typo in volumeTemplate#destroy (DTACLOUD-519)

2013-03-22 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/service/volume_template.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/lib/cimi/service/volume_template.rb b/server/lib/cimi/service/volume_template.rb index d95ba72..89d2879 100644 --- a/serve

[PATCH core 2/2] CIMI: Fixed typo in volumeConfiguration#destroy (DTACLOUD-518)

2013-03-22 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/service/volume_configuration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/lib/cimi/service/volume_configuration.rb b/server/lib/cimi/service/volume_configuration.rb index ebb2c7c..ebab1cb 100

[PATCH core] CIMI: Fixed typo in volumeTemplate#destroy (DTACLOUD-519)

2013-03-22 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/service/volume_template.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/lib/cimi/service/volume_template.rb b/server/lib/cimi/service/volume_template.rb index d95ba72..89d2879 100644 --- a/serve

[PATCH core] CIMI: Added more descriptive CIMI schema errors

2013-03-22 Thread mfojtik
From: Michal Fojtik * Wrong attribute values are not reported correctly Signed-off-by: Michal fojtik --- server/lib/cimi/models/resource.rb | 5 ++ server/lib/cimi/models/schema.rb | 88 +--- server/tests/cimi/model/errors_spec.rb | 141

[PATCH core 1/2] Core: Bumped version to 1.1.2 for the upcoming release

2013-03-12 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/deltacloud/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/lib/deltacloud/version.rb b/server/lib/deltacloud/version.rb index a21eacb..7e19d99 100644 --- a/server/lib/deltacloud/version.rb +++

[PATCH core 2/2] Core: Lock sinatra and tilt to versions known to work

2013-03-12 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/Gemfile | 2 -- server/deltacloud-core.gemspec | 9 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/server/Gemfile b/server/Gemfile index 5f3c98d..7ac1b25 100644 --- a/server/Gemfile +++ b/serv

[PATCH core] DigitalOcean: Fix filtering of realms (DTACLOUD-503)

2013-03-07 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/deltacloud/drivers/digitalocean/digitalocean_driver.rb | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/lib/deltacloud/drivers/digitalocean/digitalocean_driver.rb b/server/lib/deltacloud/drivers/d

[PATCH core 5/5] Core: Updated travis to run deltacloud-client tests

2013-03-07 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- .travis.yml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9651c9a..e720039 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,13 @@ install: - cd server - bundle install - bin/deltacl

Complete rewrite of deltacloud-client

2013-03-07 Thread mfojtik
Good news everyone! I started a complete rewrite of the deltacloud-client component of Deltacloud core repo few week ago, because: 1. Too much *magic* in the current client (meta-programming, etc) 2. No documentation (see 1)) 3. Hard to navigate in code and fix bugs (see 1,2) 4. Hard to add colle

[PATCH core 2/3] Core: Moved Deltacloud models to Deltacloud:: namespace (DTACLOUD-507)

2013-03-07 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/deltacloud/api.rb | 11 +- server/lib/deltacloud/collections/images.rb| 2 +- server/lib/deltacloud/collections/instances.rb | 4 +- server/lib/deltacloud/drivers/base_driver.rb | 1 +

[PATCH core 3/3] Core: Fixed tests to use Deltacloud::MODEL

2013-03-07 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- .../deltacloud/collections/instances_collection_test.rb| 5 - server/tests/deltacloud/common.rb | 2 +- server/tests/drivers/ec2/buckets_test.rb | 2 +- server/tests/drivers/ec2/images_te

[PATCH core 1/3] Core: make 'turn' to report colored dots

2013-03-07 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/tests/test_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/server/tests/test_helper.rb b/server/tests/test_helper.rb index 61ee26d..b0184f3 100644 --- a/server/tests/test_helper.rb +++ b/server/tests/test_helper.rb @@ -2

[PATCH core] Core: re-use core_ext methods in String if they exists (DTACLOUD-506)

2013-03-07 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/deltacloud/core_ext/array.rb | 1 + server/lib/deltacloud/core_ext/integer.rb | 22 ++ server/lib/deltacloud/core_ext/string.rb | 73 +++ 3 files changed, 59 insertions(+), 37 deletions(-)

[PATCH core] Core: Temporary fix for problem with new titl (1.3.4)

2013-03-05 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/Gemfile b/server/Gemfile index bd56845..5440691 100644 --- a/server/Gemfile +++ b/server/Gemfile @@ -2,6 +2,8 @@ source "http://rubygems.org"; gemspec +gem 'til

[PATCH core 9/9] CIMI: Use CIMI::Service namespace in Rabbit collections

2013-03-01 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/collections/address_templates.rb | 6 +++--- server/lib/cimi/collections/addresses.rb | 6 +++--- server/lib/cimi/collections/cloud_entry_point.rb | 2 +- server/lib/cimi/collections/credentials.rb

[PATCH core 6/9] CIMI: Added Service::Base#parse method

2013-03-01 Thread mfojtik
From: Michal Fojtik Make possible to call .parse on Service models from Rabbit collections. Signed-off-by: Michal fojtik --- server/lib/cimi/service/base.rb | 5 + 1 file changed, 5 insertions(+) diff --git a/server/lib/cimi/service/base.rb b/server/lib/cimi/service/base.rb index 9f2c765.

[PATCH core 7/9] FIXME: The ResourceMetadata are broken at this point

2013-03-01 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/models/schema.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/lib/cimi/models/schema.rb b/server/lib/cimi/models/schema.rb index 4ce16b9..6cbf8cc 100644 --- a/server/lib/cimi/models/schema.rb +

[PATCH core 5/9] CIMI: Migrated MachineImage to services

2013-03-01 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/collections/machine_images.rb | 6 ++-- server/lib/cimi/models/machine_image.rb | 28 --- server/lib/cimi/service.rb| 1 + server/lib/cimi/service/machine_image.rb | 51 +++

[PATCH core 4/9] CIMI: Send list of invalid parameters in message

2013-03-01 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/tests/cimi/collections/machine_templates_test.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/server/tests/cimi/collections/machine_templates_test.rb b/server/tests/cimi/collections/machine_templates_test.rb index 696052a..cfe2

[PATCH core 3/9] CIMI: Apply $filter and $select in Base#list

2013-03-01 Thread mfojtik
From: Michal Fojtik No need to have ugly chained methods in collections. Signed-off-by: Michal fojtik --- server/lib/cimi/collections/machines.rb | 2 +- server/lib/cimi/service/base.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/lib/cimi/collections/m

[PATCH core 2/9] CIMI: Fix 'views' folder location

2013-03-01 Thread mfojtik
From: Michal Fojtik In CIMI we don't have views except the error ones. Signed-off-by: Michal fojtik --- server/lib/cimi/collections/base.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/lib/cimi/collections/base.rb b/server/lib/cimi/collections/base.rb index 3

[PATCH core 1/9] CIMI: split models into model and service objects

2013-03-01 Thread mfojtik
From: David Lutterkort The current CIMI::Model classes address two concerns: * serialization/deserialization of CIMI objects * interaction with the current driver and the DB This patch splits these two concerns into two separate class hierarchies: CIMI::Model for (de)serialization and CIMI:

[PATCH core] Switch the rubygems.org source to https://rubygems.org

2013-03-01 Thread mfojtik
From: Michal Fojtik Using HTTPS connection is now prefered way how to access rubygems. Under MRI 2.0 having non-https URL will print a huge ugly warning. Signed-off-by: Michal fojtik --- server/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Gemfile b/server/

[PATCH core] Core: Added support for jruby Puma server

2013-03-01 Thread mfojtik
From: Michal Fojtik The 'puma' web server is much faster and reliable than java webrick. Signed-off-by: Michal fojtik --- server/Gemfile | 1 + server/bin/deltacloudd | 24 +--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/server/Gemfile b/server

[PATCH core 3/3] Core: Change prefix for the Sinatra::Rabbit classes

2013-02-27 Thread mfojtik
From: Michal Fojtik Sinatra::Rabbit for CIMI is now CIMI::Rabbit Sinatra::Rabbit for Deltacloud is now Deltacloud::CIMI Signed-off-by: Michal fojtik --- server/lib/deltacloud/drivers/openstack/openstack_driver.rb| 6 +++--- server/lib/deltacloud/helpers/deltacloud_helper.rb |

[PATCH core 2/3] Core: Fixed Rabbit namespacing issues with Addresses (DTACLOUD-500)

2013-02-27 Thread mfojtik
From: Michal Fojtik NOTE: A sinatra-rabbit >= 1.15 is required to make this work and to fix the bug. Signed-off-by: Michal fojtik --- server/deltacloud-core.gemspec| 2 +- server/lib/cimi/collections/base.rb | 4 server/lib/deltacloud/collections/base.rb | 4 3 file

[PATCH core 1/3] CIMI: Removed debug statements from AddressCollection

2013-02-27 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/collections/addresses.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/server/lib/cimi/collections/addresses.rb b/server/lib/cimi/collections/addresses.rb index 92aca3e..c34068d 100644 --- a/server/lib/cimi/collection

[PATCH core 2/2] Core: Fixed Rabbit namespacing issues with Addresses (DTACLOUD-500)

2013-02-27 Thread mfojtik
From: Michal Fojtik NOTE: A sinatra-rabbit >= 1.15 is required to make this work and to fix the bug. Signed-off-by: Michal fojtik --- server/deltacloud-core.gemspec| 2 +- server/lib/cimi/collections/base.rb | 4 server/lib/deltacloud/collections/base.rb | 4 3 file

[PATCH core 1/2] CIMI: Removed debug statements from AddressCollection

2013-02-27 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/collections/addresses.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/server/lib/cimi/collections/addresses.rb b/server/lib/cimi/collections/addresses.rb index 92aca3e..c34068d 100644 --- a/server/lib/cimi/collection

[PATCH core] DigitalOcean: Added support for :keys collection

2013-02-25 Thread mfojtik
From: Michal Fojtik - Added :authentication_key feature to instances Signed-off-by: Michal fojtik --- .../drivers/digitalocean/digitalocean_driver.rb| 51 +- server/lib/deltacloud/models/base_model.rb | 2 + server/lib/deltacloud/models/key.rb|

[PATCH core] CIMI: Added VolumeImageCreate model

2013-02-25 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/collections/volume_images.rb | 3 +- server/lib/cimi/models.rb | 1 + server/lib/cimi/models/volume_image.rb| 25 +- server/lib/cimi/models/volume_image_create.rb | 47 ++

[PATCH core 2/2] CIMI: Added VolumeTemplateCreate model

2013-02-25 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/collections/volume_templates.rb | 6 ++--- server/lib/cimi/models.rb| 3 ++- server/lib/cimi/models/volume_template.rb| 25 +- server/lib/cimi/models/volume_template_create.r

[PATCH core 1/2] CIMI: Fixed typo in volume_image column name in database

2013-02-25 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/db/volume_template.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/lib/db/volume_template.rb b/server/lib/db/volume_template.rb index da7d4f7..7f54c33 100644 --- a/server/lib/db/volume_template.rb +++

[PATCH core 1/3] CIMI: Added VolumeCreate model

2013-02-22 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/collections/volumes.rb | 3 +- server/lib/cimi/models.rb | 3 +- server/lib/cimi/models/volume.rb | 40 - server/lib/cimi/models/volume_configuration.rb | 3 +- se

[PATCH core 2/3] CIMI: Added ref_id helper to Base class

2013-02-22 Thread mfojtik
From: Michal Fojtik The ref_id(url) will extract the last segment of the URL and return it as an 'id'. FIXME: We should use ctx to return the ID of resource properly. Signed-off-by: Michal fojtik --- server/lib/cimi/models/base.rb | 4 1 file changed, 4 insertions(+) diff --git a/server

[PATCH core 3/3] CIMI: Use class.superclass instead of opts[:class]

2013-02-22 Thread mfojtik
From: Michal Fojtik Under latest MRI 1.9.3 the 'opts[:class]' is not visible to 'find' method and it is reported as 'method missing' With 'class.superclass' we get access to the original class we used to create Ref. Signed-off-by: Michal fojtik --- server/lib/cimi/models/schema.rb | 8 ++-

[PATCH core] Core: Run db:migrate rake task after mock:fixtures:reset

2013-02-21 Thread mfojtik
From: Michal Fojtik Since the database is erased, Deltacloud will exit(1) when started using CIMI frontend. This patch will execute the migration after mock dir cleanup. Signed-off-by: Michal fojtik --- server/Rakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/server/Rakefile b/serve

[PATCH core 5/5] Core: Fix for rake cimi:routes

2013-02-21 Thread mfojtik
From: Michal Fojtik Since we now have initializers, we not longer need to load config.ru to have all stuff initialized. Signed-off-by: Michal fojtik --- server/Rakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/Rakefile b/server/Rakefile index bcea9a2..da068b

[PATCH core 2/5] Core: Updated gemspec to include migrations and db-upgrade command

2013-02-21 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/deltacloud-core.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/deltacloud-core.gemspec b/server/deltacloud-core.gemspec index 292e6e1..a8ecce0 100644 --- a/server/deltacloud-core.gemspec +++ b/ser

[PATCH core 4/5] Core: Fix code duplication in how we load collections

2013-02-21 Thread mfojtik
From: Michal Fojtik This patch introduce new helper that provide mechanism to load all collection for the given frontend Signed-off-by: Michal fojtik --- server/lib/cimi/collections.rb | 36 +-- server/lib/cimi/models/cloud_entry_point.rb| 2 +- server/lib/de

[PATCH core 3/5] Core: Raise error if the collection is already registred in Rabbit

2013-02-21 Thread mfojtik
From: Michal Fojtik This patch will make sure you don't have two duplicate collections registred to Rabbit both for DC and CIMI. Signed-off-by: Michal fojtik --- server/lib/cimi/collections.rb | 1 + server/lib/deltacloud/collections.rb | 3 +++ 2 files changed, 4 insertions(+) diff --g

[PATCH core 1/5] Core: Do not overide log file when running as a daemon

2013-02-21 Thread mfojtik
From: Michal Fojtik The -L/--log option is ignored when you run Deltacloud in 'daemon' mode (-d). This cause Deltacloud to log into syslog even user specify the log file location explicately. Signed-off-by: Michal fojtik --- server/bin/deltacloudd | 4 +++- 1 file changed, 3 insertions(+), 1 d

Minor fixes (rev 2)

2013-02-21 Thread mfojtik
Hi, While fixing the collection loading, I realized that we have a lot of duplicated code in collection loading for CIMI and Deltacloud. In rev2 I tried to improve that with shared helper. Tracker here: http://tracker.deltacloud.org/set/334 -- Michal

[PATCH core 1/3] Core: Do not overide log file when running as a daemon

2013-02-21 Thread mfojtik
From: Michal Fojtik The -L/--log option is ignored when you run Deltacloud in 'daemon' mode (-d). This cause Deltacloud to log into syslog even user specify the log file location explicately. Signed-off-by: Michal fojtik --- server/bin/deltacloudd | 4 +++- 1 file changed, 3 insertions(+), 1 d

[PATCH core 3/3] Core: Raise error if the collection is already registred in Rabbit

2013-02-21 Thread mfojtik
From: Michal Fojtik This patch will make sure you don't have two duplicate collections registred to Rabbit both for DC and CIMI. Signed-off-by: Michal fojtik --- server/lib/cimi/collections.rb | 1 + server/lib/deltacloud/collections.rb | 3 +++ 2 files changed, 4 insertions(+) diff --g

[PATCH core 2/3] Core: Updated gemspec to include migrations and db-upgrade command

2013-02-21 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/deltacloud-core.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/deltacloud-core.gemspec b/server/deltacloud-core.gemspec index 292e6e1..a8ecce0 100644 --- a/server/deltacloud-core.gemspec +++ b/ser

[PATCH core] Mock:Cleanup in MockDriver code

2013-02-19 Thread mfojtik
From: Michal Fojtik - Removed obsoleted 'requires' (yaml, base64, etc) - REALMS moved to 'realms' method - @@METRICS_NAMES moved to Metric model - Revamped 'filter_on' methods - Next 'id' generation moved to separate method a lot of small changes ... - Improved collection filtering filter() metho

[PATCH core] Core: Fixed latest 'excon' which breaks the VCR fixtures

2013-02-19 Thread mfojtik
From: Michal Fojtik The 'excon' was updated it 0.17.0 which ultimately breaks the VCR fixtures we are using (rake test:drivers:google). Saying that we don't want to update it in gemspec should fix this issue. Signed-off-by: Michal fojtik --- server/deltacloud-core.gemspec | 2 +- 1 file chang

[PATCH core 7/7] CIMI: Print warning for pending migrations

2013-02-18 Thread mfojtik
From: Michal Fojtik We don't want to run any migrations automatically during Deltacloud server boot time, to give users chance to backup data, etc. This patch will provide a nice warning message if you start Deltacloud and you have some pending migrations to run. Signed-off-by: Michal fojtik -

[PATCH core 5/7] Core: Fix rake mock:fixtures:reset tasks to cleanup correct dir

2013-02-18 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/Rakefile | 23 ++- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/server/Rakefile b/server/Rakefile index 5938b9e..2a52ec2 100644 --- a/server/Rakefile +++ b/server/Rakefile @@ -56,32 +56,21 @@ name

[PATCH core 3/7] Core: Moved migrations to server/db/migrations

2013-02-18 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- .../migrations/1_add_realm_to_machine_template.rb | 23 ++ .../migrations/1_add_realm_to_machine_template.rb | 23 -- 2 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 server/db/

[PATCH core 4/7] Core: Don't run migrations when server starts

2013-02-18 Thread mfojtik
From: Michal Fojtik Users can now run migrations using: - bin/deltacloud-db-upgrade - rake db:migrate Signed-off-by: Michal fojtik --- server/Rakefile | 10 ++ server/bin/deltacloud-db-upgrade | 13 + server/lib/db.rb | 4 +--- 3 files cha

[PATCH core 6/7] Core: Re-use deltacloud-db-migrate in the Rake task

2013-02-18 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/Rakefile | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/server/Rakefile b/server/Rakefile index 2a52ec2..9ec9aa4 100644 --- a/server/Rakefile +++ b/server/Rakefile @@ -46,18 +46,16 @@ Gem::PackageTask.n

[PATCH core 1/7] Core: Added support for migrations to database

2013-02-18 Thread mfojtik
From: Michal Fojtik Currently everytime we add or remove attributes from DB, users need to rerun the 'rake' task to recreate the database. This patch will make possible to update the DB schema without executing the rake task. The 'migrations' extension in Sequel will check the 'schema_version'

[PATCH core 2/7] CIMI: Add support for 'realm' in MachineTemplate

2013-02-18 Thread mfojtik
From: Michal Fojtik Clients can now specify the 'realm' attribute when creating the new MachineTemplate entity. If they then use this MachineTemplate to create a new Machine, the Machine will be placed into that realm. Signed-off-by: Michal fojtik --- server/lib/cimi/models/machine.rb

Database migrations (rev 2)

2013-02-18 Thread mfojtik
Hi, This set will add support for database migrations and should work on the latest master. I added few extra features, like: - Now you get nice warning message if you are pending some migrations - Rake tasks is now super-small :) - I tried to re-use the initialization code I was thinking about

[PATCH core 6/8] Mock: Cleanup in how we create mock 'metrics'

2013-02-18 Thread mfojtik
From: Michal Fojtik Moved the code to the Metric model to keep MockDriver clean. Signed-off-by: Michal fojtik --- server/lib/deltacloud/models/metric.rb | 45 ++ 1 file changed, 45 insertions(+) diff --git a/server/lib/deltacloud/models/metric.rb b/server/lib/

[PATCH core 7/8] Tests: Be more verbose when checking state in Mock tests

2013-02-18 Thread mfojtik
From: Michal Fojtik The XML should reflect the state change of an Instance. Instead of checking the status code returned we should also verify the XML. Signed-off-by: Michal fojtik --- server/tests/deltacloud/collections/instances_collection_test.rb | 3 +++ 1 file changed, 3 insertions(+) di

[PATCH core 3/8] Core: Added possibility to define multiple features for collection

2013-02-18 Thread mfojtik
From: Michal Fojtik Instead of: feature :collection, :name feature :collection, :second_name You can now use: feature :collection, :name, :second_name, ... Signed-off-by: Michal fojtik --- server/lib/deltacloud/drivers/base_driver.rb| 16 +--- server/lib/deltacloud/drivers/e

[PATCH core 8/8] Mock: Cleanup in MockDriver code

2013-02-18 Thread mfojtik
From: Michal Fojtik - Removed obsoleted 'requires' (yaml, base64, etc) - REALMS moved to 'realms' method - @@METRICS_NAMES moved to Metric model - Revamped 'filter_on' methods - Next 'id' generation moved to separate method a lot of small changes... Signed-off-by: Michal fojtik --- server/lib

[PATCH core 5/8] Mock: Require 'yaml' in client instead of driver

2013-02-18 Thread mfojtik
From: Michal Fojtik The YAML is really required in MockClient (I think this require is not required here anyway ;-) This patch will also make .store() method return the stored object, so in driver we don't need to create a special var for it. Signed-off-by: Michal fojtik --- server/lib/deltac

[PATCH core 4/8] Core: Added possibility to run filter_on with multiple attrs

2013-02-18 Thread mfojtik
From: Michal Fojtik So instead of writing: instances = filter_on instances, :id, opts instances = filter_on instances, :realm_id, opts instances = filter_on instances, :state, opts You can now use: instances = filter_on instances, opts, :id, :realm_id, :state The backward compatibility with o

[PATCH core 1/8] Core: Fix rake mock:fixtures:reset tasks to cleanup correct dir

2013-02-18 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/Rakefile | 23 ++- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/server/Rakefile b/server/Rakefile index 5494148..4be72ba 100644 --- a/server/Rakefile +++ b/server/Rakefile @@ -46,32 +46,21 @@ Gem:

[PATCH core 2/8] Tests: Removed debugging 'puts' from openstack tests

2013-02-18 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/tests/drivers/openstack/instances_test.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/tests/drivers/openstack/instances_test.rb b/server/tests/drivers/openstack/instances_test.rb index 9adcf4b..986bc1

[PATCH core 4/4] Tests: Use 'initializers' in all our tests.

2013-02-15 Thread mfojtik
From: Michal Fojtik This patch will make possible to run our unit-tests without initializing the Deltacloud.configure classes, because we already do that in initializers. For CIMI tests, this will make sure the database directory exists. Signed-off-by: Michal fojtik --- server/tests/cimi/coll

[PATCH core 1/4] Core: Added 'lib/initializers' directory

2013-02-15 Thread mfojtik
From: Michal Fojtik Before this patch, we used to initialize stuff like database or mock directories in random places in source code. This patch should make all initialization happen in one place. Signed-off-by: Michal fojtik --- server/config.ru | 65 +---

[PATCH core 2/4] CIMI: If API_VERBOSE is enabled, log into Deltacloud logger

2013-02-15 Thread mfojtik
From: Michal Fojtik This patch will make sure that logs produced by Sequel (SQL logs) will go to DeltacloudLogger instead of default Ruby Logger. The reason is that user can set the '-L/--log' option and redirect all logs into a file. In that case, this patch will make sure that SQL logs are sav

[PATCH core 3/4] Core: Make DeltacloudLogger compatible with Ruby Logger

2013-02-15 Thread mfojtik
From: Michal Fojtik This patch will make our DeltacloudLogger more compatible wit the default Ruby 'Logger' class. Signed-off-by: Michal fojtik --- server/lib/sinatra/rack_logger.rb | 59 +++ 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/se

Introducing 'initializers'

2013-02-15 Thread mfojtik
Hi, This patch is something like a 'cleanup' in the way how we initialize things when Deltacloud server is starting up. Right now, these things are 'initialized' during server boot: 1. Mock directory is created and populated (this happen in mock driver) 2. Database file and schema is created (db

[PATCH core 2/2] Core: Set the default HAML output format to xhtml (DTACLOUD-472)

2013-02-13 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/cimi/collections/base.rb | 1 + server/lib/cimi/server.rb | 1 + server/lib/deltacloud/collections/base.rb | 1 + server/lib/deltacloud/server.rb | 1 + 4 files changed, 4 insertions(+) diff --git

[PATCH core 1/2] Core: Replace the 'json' dependency with 'json_pure'

2013-02-13 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/deltacloud-core.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/deltacloud-core.gemspec b/server/deltacloud-core.gemspec index 8df1587..d5c6731 100644 --- a/server/deltacloud-core.gemspec +++ b/serve

[PATCH core] CIMI: Fixed undefined 'default_frontend' error in CIMI tests

2013-02-12 Thread mfojtik
From: Michal Fojtik In case when db/provider model is accessed outside the Deltacloud server context (CIMI tests, CIMI client, etc...) the Deltacloud.default_frontend method is not set, because 'deltacloud_rack' is not required. This patch will add 'fallback' mode where if you use this model out

More EntityCreate CIMI models

2013-02-11 Thread mfojtik
Hi, This patch is an addition to the 1/11 set I sent earlier today (I don't want to do more spam ;-). I added more *Create models for some other entities. Things still pending: - Network* -> It lack support in Mock driver, so I can't run tests. - Volume* -> Too complex to just move the create to

[PATCH core] CIMI: Added more EntityCreate models for CIMI

2013-02-11 Thread mfojtik
From: Michal Fojtik - AddressCreate - AddressTemplateCreate - CredentialCreate - CredentialTemplateCreate - MachineImageCreate - NetworkCreate As part of this patch, all 'create' operations were moved to these EntityCreate models. Signed-off-by: Michal fojtik --- server/lib/cimi/collections/a

[PATCH core 11/11] CIMI: Added validation for 'ref' attributes

2013-02-11 Thread mfojtik
From: Michal Fojtik - Added MachineTemplateCreate action Signed-off-by: Michal fojtik --- server/lib/cimi/collections/base.rb | 2 +- server/lib/cimi/models.rb | 3 +- server/lib/cimi/models/base.rb| 14 ++-- server/lib/cimi/models/ma

[PATCH core 09/11] Core: Add custom message option for report_error()

2013-02-11 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/deltacloud/helpers/deltacloud_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/lib/deltacloud/helpers/deltacloud_helper.rb b/server/lib/deltacloud/helpers/deltacloud_helper.rb index 4575ae2

[PATCH core 10/11] CIMI: Replaced :grab_content_type helper with :current_content_type

2013-02-11 Thread mfojtik
From: Michal Fojtik In Sinatra helpers have direct access to the 'request' method, so there is no need to pass any parameter to this helper. This patch will also report unsupported media type correctly via Deltacloud exception handler with proper HTTP status code. Signed-off-by: Michal fojtik

[PATCH core 08/11] Core: Fixed JSON and XML serialization of realms

2013-02-11 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- server/lib/deltacloud/models/realm.rb | 2 +- server/views/realms/show.xml.haml | 7 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/lib/deltacloud/models/realm.rb b/server/lib/deltacloud/models/realm.rb in

[PATCH core 07/11] CIMI: Tests for CIMI validation in MachineTemplate model

2013-02-11 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- .../cimi/collections/machine_templates_test.rb | 76 ++ 1 file changed, 76 insertions(+) create mode 100644 server/tests/cimi/collections/machine_templates_test.rb diff --git a/server/tests/cimi/collections/machine_

[PATCH core 03/11] Move the logic from Machine.create_from_json and Machine.create_from_xml into MachineCreate

2013-02-11 Thread mfojtik
From: David Lutterkort Signed-off-by: Michal fojtik --- server/lib/cimi/collections/machines.rb | 7 +--- server/lib/cimi/models/machine.rb| 69 server/lib/cimi/models/machine_create.rb | 29 ++ 3 files changed, 31 insertions(+), 74 deleti

[PATCH core 06/11] CIMI: Initial inclusion of CIMI action models

2013-02-11 Thread mfojtik
From: Michal Fojtik The way of how we currently create CIMI entities is not really nice. We parse the raw JSON/XML and then we are trying to create the CIMI entity. Besides the code looks ugly, there is no way to add validation for required attributes without make it even more uglier. This patc

[PATCH core 01/11] This makes it possible to have a full MachineConfiguration object referenced from a Machinetemplate

2013-02-11 Thread mfojtik
From: David Lutterkort Signed-off-by: Michal fojtik --- server/lib/cimi/models.rb | 4 +- server/lib/cimi/models/base.rb | 5 +++ server/lib/cimi/models/machine_template.rb | 6 +-- server/lib/cimi/models/schema.rb | 44

[PATCH core 05/11] CIMI: Capture the validation errors and advertise them as HTTP 400

2013-02-11 Thread mfojtik
From: Michal Fojtik In case when client sent scrumbed XML or JSON body, this patch will make sure we send 'HTTP 400 - Bad Request' back instead of horrible looking 500 error. This patch also properly advertise the ValidationError in case when client want to create CIMI resource but the validatio

[PATCH core 02/11] CIMI models: add a MachineCreate model

2013-02-11 Thread mfojtik
From: David Lutterkort Signed-off-by: Michal fojtik --- server/lib/cimi/models.rb | 1 + server/lib/cimi/models/machine_create.rb | 18 +++ server/tests/cimi/model/machine_create_spec.rb | 44 ++ 3 files changed, 63 insertions(+) cre

CIMI actions, validations and more...

2013-02-11 Thread mfojtik
Hi, This patch-bomb is represents merged version of David patches that add the 'ref' attribute type and my validation patches. -- Michal

[PATCH core 04/11] CIMI: Initial addition of attribute validation for CIMI models

2013-02-11 Thread mfojtik
From: Michal Fojtik This addition will make possible to specify the 'required => true' option for all attributes in CIMI models, like: class Machine < Base text :name, :required => true end To run a check if the instance of Machine is valid or not you can do following: Machine.from_xml(xml_b

[PATCH core 2/4] CIMI: Add support for 'realm' in MachineTemplate

2013-02-08 Thread mfojtik
From: Michal Fojtik Clients can now specify the 'realm' attribute when creating the new MachineTemplate entity. If they then use this MachineTemplate to create a new Machine, the Machine will be placed into that realm. Signed-off-by: Michal fojtik --- server/lib/cimi/models/machine.rb

[PATCH core 4/4] Core: Don't run migrations when server starts

2013-02-08 Thread mfojtik
From: Michal Fojtik Users can now run migrations using: - bin/deltacloud-db-upgrade - rake db:migrate Signed-off-by: Michal fojtik --- server/Rakefile | 10 ++ server/bin/deltacloud-db-upgrade | 13 + server/lib/db.rb | 4 +--- 3 files cha

[PATCH core 3/4] Core: Moved migrations to server/db/migrations

2013-02-08 Thread mfojtik
From: Michal Fojtik Signed-off-by: Michal fojtik --- .../migrations/1_add_realm_to_machine_template.rb | 23 ++ .../migrations/1_add_realm_to_machine_template.rb | 23 -- 2 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 server/db/

[PATCH core 1/4] Core: Added support for migrations to database

2013-02-08 Thread mfojtik
From: Michal Fojtik Currently everytime we add or remove attributes from DB, users need to rerun the 'rake' task to recreate the database. This patch will make possible to update the DB schema without executing the rake task. The 'migrations' extension in Sequel will check the 'schema_version'

[PATCH core 2/2] CIMI: Add support for 'realm' in MachineTemplate

2013-02-07 Thread mfojtik
From: Michal Fojtik Clients can now specify the 'realm' attribute when creating the new MachineTemplate entity. If they then use this MachineTemplate to create a new Machine, the Machine will be placed into that realm. Signed-off-by: Michal fojtik --- server/lib/cimi/models/machine.rb

  1   2   3   4   5   6   7   8   >