You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2012/02/15 15:49:36 UTC

[PATCH core] RHEV-M: Fixed incompatibilities with rbovirt gem when destroying an instance or getting IP addresses

From: Michal Fojtik <mf...@redhat.com>


Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 .../lib/deltacloud/drivers/rhevm/rhevm_driver.rb   |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
index 4713321..7fa4c91 100644
--- a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
+++ b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
@@ -158,7 +158,7 @@ class RHEVMDriver < Deltacloud::BaseDriver
   def destroy_instance(credentials, id)
     client = new_client(credentials)
     safely do
-      raise "ERROR: Operation start failed" unless client.vm_action(id, :delete)
+      raise "ERROR: Operation start failed" unless client.destroy_vm(id)
     end
   end
 
@@ -237,7 +237,8 @@ class RHEVMDriver < Deltacloud::BaseDriver
     public_addresses = []
     # First try to get IP address from RHEV-M. This require rhev-agent package
     # installed on guest
-    public_addresses << InstanceAddress.new(inst.ip) if inst.ip
+    public_addresses = inst.ips.map { |ip| InstanceAddress.new(ip, :type => :ipv4) } unless inst.ips.empty?
+
     # ConfServer will overide the IP address returned by RHEV-M guest agent
     if ENV['CONFIG_SERVER_ADDRESS']
       ip = confserver_ip(inst.id)
-- 
1.7.4.4


Re: [PATCH core] RHEV-M: Fixed incompatibilities with rbovirt gem when destroying an instance or getting IP addresses

Posted by David Lutterkort <lu...@redhat.com>.
On Wed, 2012-02-15 at 15:49 +0100, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mf...@redhat.com>

ACK

One nit:
 
> @@ -237,7 +237,8 @@ class RHEVMDriver < Deltacloud::BaseDriver
>      public_addresses = []
>      # First try to get IP address from RHEV-M. This require rhev-agent package
>      # installed on guest
> -    public_addresses << InstanceAddress.new(inst.ip) if inst.ip
> +    public_addresses = inst.ips.map { |ip| InstanceAddress.new(ip, :type => :ipv4) } unless inst.ips.empty?

The 'unless' check is not needed (and then you can drop the
initialization of public_addresses to [], too)

David