You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2012/03/09 18:42:47 UTC
[PATCH 2/4] CIMI - Adds network configuration calls for mock driver
From: marios <ma...@redhat.com>
Signed-off-by: marios <ma...@redhat.com>
---
server/lib/cimi/model/network_configuration.rb | 7 +++----
server/lib/cimi/server.rb | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/server/lib/cimi/model/network_configuration.rb b/server/lib/cimi/model/network_configuration.rb
index b329919..1b04548 100644
--- a/server/lib/cimi/model/network_configuration.rb
+++ b/server/lib/cimi/model/network_configuration.rb
@@ -34,17 +34,16 @@ class CIMI::Model::NetworkConfiguration < CIMI::Model::Base
def self.find(id, context)
network_configs = []
if id==:all
-
+ network_configs = context.driver.network_configurations(context.credentials, {:env=>context})
else
-
+ network_configs = context.driver.network_configurations(context.credentials, {:env=>context, :id=>id})
end
network_configs
end
-require 'cimi/model/network_configuration_collection'
+
def self.create_from_xml(request_body, context)
end
def self.create_from_json(request_body, context)
end
-
end
diff --git a/server/lib/cimi/server.rb b/server/lib/cimi/server.rb
index 2a90c0e..9dd0b3f 100644
--- a/server/lib/cimi/server.rb
+++ b/server/lib/cimi/server.rb
@@ -565,7 +565,7 @@ global_collection :network_configurations do
param :id, :string, :required
control do
network_config = NetworkConfiguration.find(params[:id], self)
- respond_to do
+ respond_to do |format|
format.xml { network_config.to_xml }
format.json { network_config.to_json }
end
--
1.7.6.5
Re: [PATCH 2/4] CIMI - Adds network configuration calls for mock driver
Posted by Michal Fojtik <mi...@mifo.sk>.
On Mar 9, 2012, at 6:42 PM, marios@redhat.com wrote:
ACK.
-- Michal
> From: marios <ma...@redhat.com>
>
>
> Signed-off-by: marios <ma...@redhat.com>
> ---
> server/lib/cimi/model/network_configuration.rb | 7 +++----
> server/lib/cimi/server.rb | 2 +-
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/server/lib/cimi/model/network_configuration.rb b/server/lib/cimi/model/network_configuration.rb
> index b329919..1b04548 100644
> --- a/server/lib/cimi/model/network_configuration.rb
> +++ b/server/lib/cimi/model/network_configuration.rb
> @@ -34,17 +34,16 @@ class CIMI::Model::NetworkConfiguration < CIMI::Model::Base
> def self.find(id, context)
> network_configs = []
> if id==:all
> -
> + network_configs = context.driver.network_configurations(context.credentials, {:env=>context})
> else
> -
> + network_configs = context.driver.network_configurations(context.credentials, {:env=>context, :id=>id})
> end
> network_configs
> end
> -require 'cimi/model/network_configuration_collection'
> +
> def self.create_from_xml(request_body, context)
> end
>
> def self.create_from_json(request_body, context)
> end
> -
> end
> diff --git a/server/lib/cimi/server.rb b/server/lib/cimi/server.rb
> index 2a90c0e..9dd0b3f 100644
> --- a/server/lib/cimi/server.rb
> +++ b/server/lib/cimi/server.rb
> @@ -565,7 +565,7 @@ global_collection :network_configurations do
> param :id, :string, :required
> control do
> network_config = NetworkConfiguration.find(params[:id], self)
> - respond_to do
> + respond_to do |format|
> format.xml { network_config.to_xml }
> format.json { network_config.to_json }
> end
> --
> 1.7.6.5
>