You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by dk...@apache.org on 2013/06/21 13:25:58 UTC

[1/2] git commit: CIMI: Added #collection_class_for helper to CIMI client

Updated Branches:
  refs/heads/master f79783528 -> 8eda668a9


CIMI: Added #collection_class_for helper to CIMI client

Since now the collection classes are not available in the
namespace, this helper will generate them in the client.


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/8eda668a
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/8eda668a
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/8eda668a

Branch: refs/heads/master
Commit: 8eda668a957f8b7e898568fa507866d928c0d9e1
Parents: 01541b0
Author: Michal Fojtik <mf...@redhat.com>
Authored: Thu Jun 13 13:37:27 2013 +0200
Committer: Dies Koper <di...@fast.au.fujitsu.com>
Committed: Fri Jun 21 21:16:06 2013 +1000

----------------------------------------------------------------------
 clients/cimi/lib/cimi_frontend_helper.rb | 6 ++++++
 clients/cimi/lib/entities/machine.rb     | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8eda668a/clients/cimi/lib/cimi_frontend_helper.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/cimi_frontend_helper.rb b/clients/cimi/lib/cimi_frontend_helper.rb
index 99dbc7c..314ec91 100644
--- a/clients/cimi/lib/cimi_frontend_helper.rb
+++ b/clients/cimi/lib/cimi_frontend_helper.rb
@@ -39,6 +39,12 @@ module CIMI
         obj.class.name.split('::').last
       end
 
+      # Generate the CIMI collection class for given model
+      #
+      def collection_class_for(model_name)
+        CIMI::Model::Collection.generate(CIMI::Model.const_get(model_name.to_s.camelize))
+      end
+
       def flash_block_for(message_type)
         return unless flash[message_type]
         capture_haml do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8eda668a/clients/cimi/lib/entities/machine.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/machine.rb b/clients/cimi/lib/entities/machine.rb
index 6135e62..fef25c8 100644
--- a/clients/cimi/lib/entities/machine.rb
+++ b/clients/cimi/lib/entities/machine.rb
@@ -38,18 +38,18 @@ class CIMI::Frontend::Machine < CIMI::Frontend::Entity
   get '/cimi/machines' do
     # We need to include this stuff for new Machine Form
     machine_image_xml = get_entity_collection('machine_images', credentials)
-    @machine_images = CIMI::Model::MachineImageCollection.from_xml(machine_image_xml)
+    @machine_images = collection_class_for(:machine_image).from_xml(machine_image_xml)
     machine_conf_xml = get_entity_collection('machine_configurations', credentials)
-    @machine_configurations = CIMI::Model::MachineConfigurationCollection.from_xml(machine_conf_xml)
+    @machine_configurations = collection_class_for(:machine_configuration).from_xml(machine_conf_xml)
     begin
       machine_admins_xml = get_entity_collection('machine_admins', credentials)
-      @machine_admins = CIMI::Model::MachineAdminCollection.from_xml(machine_admins_xml)
+      @machine_admins = collection_class_for(:machine_admin).from_xml(machine_admins_xml)
       # In case backend does not support MachineAdmin collection
     rescue RestClient::ResourceNotFound
       @machine_admins = []
     end
     machine_xml = get_entity_collection('machines', credentials)
-    @machines = CIMI::Model::MachineCollection.from_xml(machine_xml)
+    @machines = collection_class_for(:machine).from_xml(machine_xml)
     haml :'machines/index'
   end
 


[2/2] git commit: CIMI: Fixed dependencies loading from CIMI client

Posted by dk...@apache.org.
CIMI: Fixed dependencies loading from CIMI client


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/01541b03
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/01541b03
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/01541b03

Branch: refs/heads/master
Commit: 01541b03e9d20e64d198cf3ee56d89bf2683e95b
Parents: f797835
Author: Michal Fojtik <mf...@redhat.com>
Authored: Thu Jun 13 13:27:23 2013 +0200
Committer: Dies Koper <di...@fast.au.fujitsu.com>
Committed: Fri Jun 21 21:16:06 2013 +1000

----------------------------------------------------------------------
 clients/cimi/Gemfile                            |   2 +
 clients/cimi/Gemfile.lock                       | 114 +++++++++++++++++--
 clients/cimi/init.rb                            |   5 +
 .../lib/initializers/dependencies_initialize.rb |   1 +
 4 files changed, 110 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/01541b03/clients/cimi/Gemfile
----------------------------------------------------------------------
diff --git a/clients/cimi/Gemfile b/clients/cimi/Gemfile
index 326cc61..a9539aa 100644
--- a/clients/cimi/Gemfile
+++ b/clients/cimi/Gemfile
@@ -7,3 +7,5 @@ gem 'json'
 #gem 'xmlsimple'
 gem 'rest-client'
 gem 'nokogiri'
+
+gemspec :path => File.join(File.dirname(__FILE__), '..', '..', 'server')

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/01541b03/clients/cimi/Gemfile.lock
----------------------------------------------------------------------
diff --git a/clients/cimi/Gemfile.lock b/clients/cimi/Gemfile.lock
index 5ce2c94..de899ae 100644
--- a/clients/cimi/Gemfile.lock
+++ b/clients/cimi/Gemfile.lock
@@ -1,42 +1,132 @@
+PATH
+  remote: /home/mfojtik/code/core/server
+  specs:
+    deltacloud-core (1.1.3)
+      aws (>= 2.7.0)
+      cloudfiles
+      cloudservers
+      fog (>= 1.4.0)
+      haml (>= 2.2.17)
+      json_pure (>= 1.5.0)
+      net-ssh (>= 2.0.0)
+      nokogiri (>= 1.4.3)
+      openstack (>= 1.0.9)
+      rack (>= 1.0.0)
+      rack-accept
+      rake (>= 0.8.7)
+      rbovirt (>= 0.0.19)
+      rbvmomi
+      rest-client
+      savon (>= 1.0.0)
+      sequel
+      sinatra
+      sinatra-rabbit (>= 1.1.6)
+      sqlite3
+      thin (>= 1.2.5)
+      tilt
+      uuidtools (>= 2.1.1)
+      waz-storage (>= 1.1.0)
+
 GEM
   remote: http://rubygems.org/
   specs:
-    backports (2.6.4)
-    eventmachine (1.0.0)
+    akami (1.2.0)
+      gyoku (>= 0.4.0)
+      nokogiri (>= 1.4.0)
+    aws (2.9.1)
+      http_connection
+      uuidtools
+      xml-simple
+    builder (3.2.0)
+    cloudfiles (1.5.0.1)
+      json
+    cloudservers (0.4.2)
+      json
+    daemons (1.1.9)
+    eventmachine (1.0.3)
+    excon (0.21.0)
+    fog (1.11.1)
+      builder
+      excon (~> 0.20)
+      formatador (~> 0.2.0)
+      json (~> 1.7)
+      mime-types
+      net-scp (~> 1.1)
+      net-ssh (>= 2.1.3)
+      nokogiri (~> 1.5.0)
+      ruby-hmac
+    formatador (0.2.4)
+    gyoku (1.0.0)
+      builder (>= 2.1.2)
     haml (3.1.7)
+    http_connection (1.4.4)
+    httpi (2.0.2)
+      rack
     json (1.7.5)
+    json_pure (1.8.0)
     mime-types (1.19)
+    net-scp (1.1.1)
+      net-ssh (>= 2.6.5)
+    net-ssh (2.6.7)
     nokogiri (1.5.5)
+    nori (2.1.0)
+    openstack (1.1.0)
+      json
     rack (1.4.1)
     rack-accept (0.4.5)
       rack (>= 0.4)
     rack-protection (1.2.0)
       rack
-    rack-test (0.6.1)
-      rack (>= 1.0)
+    rake (10.0.4)
+    rbovirt (0.0.19)
+      nokogiri
+      rest-client
+    rbvmomi (1.6.0)
+      builder
+      nokogiri (>= 1.4.1)
+      trollop
     rest-client (1.6.7)
       mime-types (>= 1.16)
+    ruby-hmac (0.4.0)
+    savon (2.2.0)
+      akami (~> 1.2.0)
+      builder (>= 2.1.2)
+      gyoku (~> 1.0.0)
+      httpi (~> 2.0.2)
+      nokogiri (>= 1.4.0)
+      nori (~> 2.1.0)
+      wasabi (~> 3.1.0)
+    sequel (3.46.0)
     sinatra (1.3.3)
       rack (~> 1.3, >= 1.3.6)
       rack-protection (~> 1.2)
       tilt (~> 1.3, >= 1.3.3)
-    sinatra-contrib (1.3.1)
-      backports (>= 2.0)
-      eventmachine
-      rack-protection
-      rack-test
-      sinatra (~> 1.3.0)
-      tilt (~> 1.3)
+    sinatra-rabbit (1.1.6)
+      sinatra (>= 1.3.0)
+    sqlite3 (1.3.7)
+    thin (1.5.1)
+      daemons (>= 1.0.9)
+      eventmachine (>= 0.12.6)
+      rack (>= 1.0.0)
     tilt (1.3.3)
+    trollop (2.0)
+    uuidtools (2.1.4)
+    wasabi (3.1.0)
+      httpi (~> 2.0)
+      nokogiri (>= 1.4.0)
+    waz-storage (1.3.6)
+      rest-client
+      ruby-hmac
+    xml-simple (1.1.2)
 
 PLATFORMS
   ruby
 
 DEPENDENCIES
+  deltacloud-core!
   haml
   json
   nokogiri
   rack-accept
   rest-client
   sinatra
-  sinatra-contrib

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/01541b03/clients/cimi/init.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/init.rb b/clients/cimi/init.rb
index 37c347a..698e29e 100644
--- a/clients/cimi/init.rb
+++ b/clients/cimi/init.rb
@@ -35,5 +35,10 @@ require 'deltacloud/core_ext'
 require 'json/pure'
 
 require 'initializers/mock_initialize'
+
+ENV['API_PRODUCTION'] = '1'
+ENV['API_FRONTEND'] = 'cimi'
+
+require 'initializers/dependencies_initialize'
 require 'initializers/database_initialize'
 require 'cimi/models'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/01541b03/server/lib/initializers/dependencies_initialize.rb
----------------------------------------------------------------------
diff --git a/server/lib/initializers/dependencies_initialize.rb b/server/lib/initializers/dependencies_initialize.rb
index e9f6f62..25c5ec9 100644
--- a/server/lib/initializers/dependencies_initialize.rb
+++ b/server/lib/initializers/dependencies_initialize.rb
@@ -31,6 +31,7 @@ module Deltacloud
   #
   def self.is_production?
     current_path = File.expand_path(File.dirname(__FILE__))
+    return true if ENV['API_PRODUCTION']
     return true if Gem.path[0..Gem.path.length] == current_path
     return true if current_path[0..10] == '/usr/share'
     false