deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: CIMI Systems: fix for DTACLOUD-559 - id was not set for SystemMachineCollection and SystemVolumeCollection
Date Fri, 24 May 2013 07:48:56 GMT
Updated Branches:
  refs/heads/master 0e7ab2551 -> 640405627


CIMI Systems: fix for DTACLOUD-559 - id was not set for SystemMachineCollection and SystemVolumeCollection

https://issues.apache.org/jira/browse/DTACLOUD-559
https://github.com/deltacloud/deltacloud-core/pull/28
https://github.com/deltacloud/deltacloud-core/pull/27


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

Branch: refs/heads/master
Commit: 640405627827bdf0d38e3418647d2d36fd272d74
Parents: 0e7ab25
Author: marios <marios@redhat.com>
Authored: Fri May 24 10:47:26 2013 +0300
Committer: marios <marios@redhat.com>
Committed: Fri May 24 10:47:26 2013 +0300

----------------------------------------------------------------------
 server/lib/cimi/models/collection.rb               |    5 -----
 server/lib/cimi/service/system_address.rb          |    5 +++--
 server/lib/cimi/service/system_forwarding_group.rb |    5 +++--
 server/lib/cimi/service/system_machine.rb          |    4 ++--
 server/lib/cimi/service/system_network.rb          |    5 +++--
 server/lib/cimi/service/system_volume.rb           |    4 ++--
 6 files changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/64040562/server/lib/cimi/models/collection.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/collection.rb b/server/lib/cimi/models/collection.rb
index 3eb540c..ac2ad37 100644
--- a/server/lib/cimi/models/collection.rb
+++ b/server/lib/cimi/models/collection.rb
@@ -78,11 +78,6 @@ module CIMI::Model
         unless self.href || self.id
           raise "Collection #{self.class.name} must have one of id and href set"
         end
-        if self.href && self.id && self.href != self.id
-          puts "jjv -100- models/collections.rb self.href ->#{self.href}<-"
-          puts "jjv -110- models/collections.rb self.id ->#{self.id}<-"
-          # JJV raise "id and href must be identical for collection #{self.class.name}, id
= #{id.inspect}, href = #{href.inspect}"
-        end
         self.href ||= self.id
         self.id ||= self.href
       end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/64040562/server/lib/cimi/service/system_address.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/system_address.rb b/server/lib/cimi/service/system_address.rb
index 83ac075..4745ffa 100644
--- a/server/lib/cimi/service/system_address.rb
+++ b/server/lib/cimi/service/system_address.rb
@@ -28,8 +28,9 @@ class CIMI::Service::SystemAddress < CIMI::Service::Base
 
   def self.collection_for_system(system_id, context)
     system_addresses = self.find(system_id, context)
-    addresses_url = context.system_addresses_url(system_id) if context.driver.has_capability?
:add_addresses_to_system
-    CIMI::Model::SystemAddress.list(addresses_url, system_addresses, :add_url => addresses_url)
+    addresses_url = context.system_addresses_url(system_id)
+    CIMI::Model::SystemAddress.list(addresses_url, system_addresses, :add_url =>(context.driver.has_capability?(:create_system_address)
? addresses_url : nil))
+
   end
 
 end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/64040562/server/lib/cimi/service/system_forwarding_group.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/system_forwarding_group.rb b/server/lib/cimi/service/system_forwarding_group.rb
index 69012d8..8b1a7d9 100644
--- a/server/lib/cimi/service/system_forwarding_group.rb
+++ b/server/lib/cimi/service/system_forwarding_group.rb
@@ -28,8 +28,9 @@ class CIMI::Service::SystemForwardingGroup < CIMI::Service::Base
 
   def self.collection_for_system(system_id, context)
     system_forwarding_groups = self.find(system_id, context)
-    forwarding_groups_url = context.system_forwarding_groups_url(system_id) if context.driver.has_capability?
:add_forwarding_groups_to_system
-    CIMI::Model::SystemForwardingGroup.list(forwarding_groups_url, system_forwarding_groups,
:add_url => forwarding_groups_url)
+    forwarding_groups_url = context.system_forwarding_groups_url(system_id)
+    CIMI::Model::SystemForwardingGroup.list(forwarding_groups_url, system_forwarding_groups,
:add_url => (context.driver.has_capability?(:create_system_forwarding_group) ? forwarding_groups_url
: nil))
+
   end
 
 end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/64040562/server/lib/cimi/service/system_machine.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/system_machine.rb b/server/lib/cimi/service/system_machine.rb
index cdf515e..d5be1f9 100644
--- a/server/lib/cimi/service/system_machine.rb
+++ b/server/lib/cimi/service/system_machine.rb
@@ -28,8 +28,8 @@ class CIMI::Service::SystemMachine < CIMI::Service::Base
 
   def self.collection_for_system(system_id, context)
     system_machines = self.find(system_id, context)
-    machines_url = context.system_machines_url(system_id) if context.driver.has_capability?
:add_machines_to_system
-    CIMI::Model::SystemMachine.list(machines_url, system_machines, :add_url => machines_url)
+    machines_url = context.system_machines_url(system_id)
+    CIMI::Model::SystemMachine.list(machines_url, system_machines, :add_url => (context.driver.has_capability?(:create_system_machine)
? machines_url : nil))
   end
 
 end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/64040562/server/lib/cimi/service/system_network.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/system_network.rb b/server/lib/cimi/service/system_network.rb
index a921910..e64043c 100644
--- a/server/lib/cimi/service/system_network.rb
+++ b/server/lib/cimi/service/system_network.rb
@@ -28,8 +28,9 @@ class CIMI::Service::SystemNetwork < CIMI::Service::Base
 
   def self.collection_for_system(system_id, context)
     system_networks = self.find(system_id, context)
-    networks_url = context.system_networks_url(system_id) if context.driver.has_capability?
:add_networks_to_system
-    CIMI::Model::SystemNetwork.list(networks_url, system_networks, :add_url => networks_url)
+    networks_url = context.system_networks_url(system_id)
+    CIMI::Model::SystemNetwork.list(networks_url, system_networks, :add_url => (context.driver.has_capability?(:create_system_network)
? networks_url : nil))
+
   end
 
 end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/64040562/server/lib/cimi/service/system_volume.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/system_volume.rb b/server/lib/cimi/service/system_volume.rb
index 431c7a0..4434fa9 100644
--- a/server/lib/cimi/service/system_volume.rb
+++ b/server/lib/cimi/service/system_volume.rb
@@ -28,8 +28,8 @@ class CIMI::Service::SystemVolume < CIMI::Service::Base
 
   def self.collection_for_system(system_id, context)
     system_volumes = self.find(system_id, context)
-    volumes_url = context.system_volumes_url(system_id) if context.driver.has_capability?
:add_volumes_to_system
-    CIMI::Model::SystemVolume.list(volumes_url, system_volumes, :add_url => volumes_url)
+    volumes_url = context.system_volumes_url(system_id)
+    CIMI::Model::SystemVolume.list(volumes_url, system_volumes, :add_url => (context.driver.has_capability?(:create_system_volume)
? volumes_url : nil))
   end
 
 end


Mime
View raw message