From a4a298b73af3b93af428020bfd3c86ca702a6297 Mon Sep 17 00:00:00 2001 From: Mike Pountney Date: Tue, 25 Feb 2014 09:17:46 +0000 Subject: [PATCH] Add deprecation warning for get_network get_network is being deprecated in favour of get_network_complete, which returns the complete GET-Network API response from vCloud. This is a transitional step - see https://github.com/fog/fog/pull/2683 In a future release, get_network will be replaced with the logic from get_network_complete, and then get_network_complete deprecated accordingly. The network Model has been updated to use get_network_complete already. Any code that relies on existing get_network behaviour should be updated to use get_network_complete or the Model asap. --- lib/fog/vcloud_director/requests/compute/get_network.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/fog/vcloud_director/requests/compute/get_network.rb b/lib/fog/vcloud_director/requests/compute/get_network.rb index e1a9a5ba5..1d3516942 100644 --- a/lib/fog/vcloud_director/requests/compute/get_network.rb +++ b/lib/fog/vcloud_director/requests/compute/get_network.rb @@ -6,6 +6,8 @@ module Fog # Retrieve an organization network. # + # @deprecated Use {#get_network_complete} instead + # # @param [String] id Object identifier of the network. # @return [Excon::Response] # * body<~Hash>: @@ -15,6 +17,7 @@ module Fog # @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/GET-Network.html # @since vCloud API version 0.9 def get_network(id) + Fog::Logger.deprecation("#{self} => #get_network is deprecated, use #get_network_complete instead [light_black](#{caller.first})[/]") request( :expects => 200, :idempotent => true, @@ -27,6 +30,7 @@ module Fog class Mock def get_network(id) + Fog::Logger.deprecation("#{self} => #get_network is deprecated, use #get_network_complete instead [light_black](#{caller.first})[/]") unless network = data[:networks][id] raise Fog::Compute::VcloudDirector::Forbidden.new( 'This operation is denied.'