Return-Path: X-Original-To: apmail-deltacloud-dev-archive@www.apache.org Delivered-To: apmail-deltacloud-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 790E999D4 for ; Wed, 29 Feb 2012 11:34:16 +0000 (UTC) Received: (qmail 14591 invoked by uid 500); 29 Feb 2012 11:34:16 -0000 Delivered-To: apmail-deltacloud-dev-archive@deltacloud.apache.org Received: (qmail 14569 invoked by uid 500); 29 Feb 2012 11:34:16 -0000 Mailing-List: contact dev-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list dev@deltacloud.apache.org Received: (qmail 14550 invoked by uid 99); 29 Feb 2012 11:34:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 11:34:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.97.132.83] (HELO homiemail-a5.g.dreamhost.com) (208.97.132.83) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 11:34:08 +0000 Received: from homiemail-a5.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a5.g.dreamhost.com (Postfix) with ESMTP id E55F0704076 for ; Wed, 29 Feb 2012 03:33:46 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=opennebula.org; h=mime-version :in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; q=dns; s=opennebula.org ; b=gf2h28fN002eJ90yLQ3VEhHsKaBrIU2nYSZHRTvQ8PxO9VVBKzZfZWrZh+Ag qbCPOJRi4FAytFmINBoJ76tV9dOSSc4MH88sQbT+eqpJ5yeU0IJWLBghSGsHG/ow i1EZfFtlRyBW6qp4pEjBhN6NSbfCzXZbmLCTcei5YA0Cjfg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=opennebula.org; h= mime-version:in-reply-to:references:from:date:message-id:subject :to:content-type:content-transfer-encoding; s=opennebula.org; bh=RxAylZGAoLMjdGpagDsSKr67dH0=; b=yD+7D7mhVyPw7w5PEgaw3zGqVf5O 4BCDmpA9DVB9I0/FOHQUIjTdJTl1Z5FPGyB3iOQb9tZFsREmLn2K4hGH+2y23jYs C0QvX4EO0xFjwHYJnLgE8v/XC8iWGC82ywy5x4wb/60IysV6MUK63lPAS4z9NhaY DfOhxenAt9B88tc= Received: from mail-gx0-f173.google.com (mail-gx0-f173.google.com [209.85.161.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: dmolina@opennebula.org) by homiemail-a5.g.dreamhost.com (Postfix) with ESMTPSA id B62E470406E for ; Wed, 29 Feb 2012 03:33:46 -0800 (PST) Received: by ggnj2 with SMTP id j2so1627973ggn.32 for ; Wed, 29 Feb 2012 03:33:45 -0800 (PST) Received-SPF: pass (google.com: domain of dmolina@opennebula.org designates 10.236.78.6 as permitted sender) client-ip=10.236.78.6; Authentication-Results: mr.google.com; spf=pass (google.com: domain of dmolina@opennebula.org designates 10.236.78.6 as permitted sender) smtp.mail=dmolina@opennebula.org Received: from mr.google.com ([10.236.78.6]) by 10.236.78.6 with SMTP id f6mr34976827yhe.109.1330515225819 (num_hops = 1); Wed, 29 Feb 2012 03:33:45 -0800 (PST) Received: by 10.236.78.6 with SMTP id f6mr26563150yhe.109.1330515225792; Wed, 29 Feb 2012 03:33:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.138.228 with HTTP; Wed, 29 Feb 2012 03:33:24 -0800 (PST) In-Reply-To: <1EA71DC7-B0D2-4D2F-B034-34AF358DEF1F@redhat.com> References: <1EA71DC7-B0D2-4D2F-B034-34AF358DEF1F@redhat.com> From: Daniel Molina Date: Wed, 29 Feb 2012 12:33:24 +0100 Message-ID: Subject: Re: [PATCH] Fix minor bugs in OpenNebula driver To: dev@deltacloud.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Michal On 29 February 2012 11:37, Michal Fojtik wrote: > Hi Daniel, > > Applying: This patch fixes some minor bugs in the OpenNebula driver: > fatal: corrupt patch at line 53 > Patch failed at 0001 This patch fixes some minor bugs in the OpenNebula d= river: > > Seems like the patch is somehow corrupted. I was not able to find any rea= son > inside patch. Can you please check if it apply to master? I can apply it without any problem: -------8<---------------- dmolina:[~/deltacloud](master) $ git pull --rebase Already up-to-date. dmolina:[~/deltacloud](master) $ git am /tmp/0001-Fix-minor-bugs-in-OpenNebula-driver.patch Applying: Fix minor bugs in OpenNebula driver dmolina:[~/deltacloud](master) $ git log commit 384cd59218422eb5c07a1ac545ed2d7ae62fc42d Author: Daniel Molina Date: Tue Feb 28 17:34:49 2012 +0100 Fix minor bugs in OpenNebula driver commit a1f81d29dfd0e09be45f4e281f68cdcc1f945a4a Author: marios Date: Tue Feb 28 17:53:24 2012 +0200 Minor edit to handle case of no backtrace in ValidationFailure -------8<---------------- I attach the patch again: $ cat /tmp/0001-Fix-minor-bugs-in-OpenNebula-driver.patch >From c1e86bbaf5a7429edf4a211b022a2d9d69551ce8 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 28 Feb 2012 17:34:49 +0100 Subject: [PATCH] Fix minor bugs in OpenNebula driver --- .../deltacloud/drivers/opennebula/occi_client.rb | 6 ++++-- .../drivers/opennebula/opennebula_driver.rb | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/server/lib/deltacloud/drivers/opennebula/occi_client.rb b/server/lib/deltacloud/drivers/opennebula/occi_client.rb index 574cb88..8688995 100644 --- a/server/lib/deltacloud/drivers/opennebula/occi_client.rb +++ b/server/lib/deltacloud/drivers/opennebula/occi_client.rb @@ -69,7 +69,7 @@ module OCCIClient # Retieves the available Instance types ###################################################################### def get_instance_types - get('/instance_type') + get('/instance_type?verbose=3Dyes') end ###################################################################### @@ -277,7 +277,9 @@ module OCCIClient def get(path) url =3D URI.parse(@endpoint+path) - req =3D Net::HTTP::Get.new(url.path) + path =3D url.path + path << "?#{url.query}" if url.query + req =3D Net::HTTP::Get.new(path) do_request(url, req) end diff --git a/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb b/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb index 3b00eca..dfb679d 100644 --- a/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb +++ b/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb @@ -234,6 +234,7 @@ class OpennebulaDriver < Deltacloud::BaseDriver :owner_id=3D>credentials.user, :state=3D>"AVAILABLE", :architecture=3D>storage['ARCH'], + :hardware_profiles=3D>hardware_profiles(credentials) } ) end @@ -243,8 +244,7 @@ class OpennebulaDriver < Deltacloud::BaseDriver computehash =3D compute.root.elements network =3D [] - computehash.each('NIC/IP') {|ip| network< :ipv4)} image_id =3D nil if computehash['DISK/STORAGE'] image_id =3D computehash['DISK/STORAGE'].attributes['href'].split("/"= ).last @@ -255,11 +255,11 @@ class OpennebulaDriver < Deltacloud::BaseDriver :owner_id=3D>credentials.user, :name=3D>computehash['NAME'].text, :image_id=3D>image_id, - :instance_profile=3D>InstanceProfile.new(computehash['INSTANCE_TYPE'= ]||'small'), + :instance_profile=3D>InstanceProfile.new(computehash['INSTANCE_TYPE'= ].text||'small'), :realm_id=3D>'ONE', :state=3D>VM_STATES[computehash['STATE'].text], - :public_addreses=3D>network, - :private_addreses=3D>[], + :public_addresses=3D>network, + :private_addresses=3D>[], :actions=3D> instance_actions_for( VM_STATES[computehash['STATE'].tex= t] ) } ) end -- 1.7.1 Cheers > > Thanks!, > =A0Michal > > Michal Fojtik > http://deltacloud.org > mfojtik@redhat.com > > > > On Feb 28, 2012, at 5:57 PM, Daniel Molina wrote: > >> From: Daniel Molina >> >> This patch fixes some minor bugs in the OpenNebula driver: >> * Add verbose mode to the instance_type request >> * Add hardware_profiles to all the images. If this parameter is not >> defined, the GUI will crash when trying to show an image. >> * Fix addresses typo >> >> Signed-off-by: Daniel Molina >> --- >> .../deltacloud/drivers/opennebula/occi_client.rb =A0 | =A0 =A06 ++++-- >> .../drivers/opennebula/opennebula_driver.rb =A0 =A0 =A0 =A0| =A0 10 ++++= +----- >> 2 files changed, 9 insertions(+), 7 deletions(-) >> >> diff --git a/server/lib/deltacloud/drivers/opennebula/occi_client.rb >> b/server/lib/deltacloud/drivers/opennebula/occi_client.rb >> index 574cb88..8688995 100644 >> --- a/server/lib/deltacloud/drivers/opennebula/occi_client.rb >> +++ b/server/lib/deltacloud/drivers/opennebula/occi_client.rb >> @@ -69,7 +69,7 @@ module OCCIClient >> =A0 =A0 # Retieves the available Instance types >> =A0 =A0 ################################################################= ###### >> =A0 =A0 def get_instance_types >> - =A0 =A0 =A0get('/instance_type') >> + =A0 =A0 =A0get('/instance_type?verbose=3Dyes') >> =A0 =A0 end >> >> =A0 =A0 ################################################################= ###### >> @@ -277,7 +277,9 @@ module OCCIClient >> >> =A0 =A0 def get(path) >> =A0 =A0 =A0 url =3D URI.parse(@endpoint+path) >> - =A0 =A0 =A0req =3D Net::HTTP::Get.new(url.path) >> + =A0 =A0 =A0path =3D url.path >> + =A0 =A0 =A0path << "?#{url.query}" if url.query >> + =A0 =A0 =A0req =3D Net::HTTP::Get.new(path) >> >> =A0 =A0 =A0 do_request(url, req) >> =A0 =A0 end >> diff --git a/server/lib/deltacloud/drivers/opennebula/opennebula_driver.= rb >> b/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb >> index 3b00eca..dfb679d 100644 >> --- a/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb >> +++ b/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb >> @@ -234,6 +234,7 @@ class OpennebulaDriver < Deltacloud::BaseDriver >> =A0 =A0 =A0 :owner_id=3D>credentials.user, >> =A0 =A0 =A0 :state=3D>"AVAILABLE", >> =A0 =A0 =A0 :architecture=3D>storage['ARCH'], >> + =A0 =A0 =A0:hardware_profiles=3D>hardware_profiles(credentials) >> =A0 =A0 } ) >> =A0 end >> >> @@ -243,8 +244,7 @@ class OpennebulaDriver < Deltacloud::BaseDriver >> =A0 =A0 computehash =3D compute.root.elements >> >> =A0 =A0 network =3D [] >> - =A0 =A0computehash.each('NIC/IP') {|ip| network<> - >> + =A0 =A0computehash.each('NIC/IP') {|ip| >> network< :ipv4)} >> =A0 =A0 image_id =3D nil >> =A0 =A0 if computehash['DISK/STORAGE'] >> =A0 =A0 =A0 image_id =3D computehash['DISK/STORAGE'].attributes['href'].= split("/").last >> @@ -255,11 +255,11 @@ class OpennebulaDriver < Deltacloud::BaseDriver >> =A0 =A0 =A0 :owner_id=3D>credentials.user, >> =A0 =A0 =A0 :name=3D>computehash['NAME'].text, >> =A0 =A0 =A0 :image_id=3D>image_id, >> - =A0 =A0 =A0:instance_profile=3D>InstanceProfile.new(computehash['INSTA= NCE_TYPE']||'small'), >> + =A0 =A0 =A0:instance_profile=3D>InstanceProfile.new(computehash['INSTA= NCE_TYPE'].text||'small'), >> =A0 =A0 =A0 :realm_id=3D>'ONE', >> =A0 =A0 =A0 :state=3D>VM_STATES[computehash['STATE'].text], >> - =A0 =A0 =A0:public_addreses=3D>network, >> - =A0 =A0 =A0:private_addreses=3D>[], >> + =A0 =A0 =A0:public_addresses=3D>network, >> + =A0 =A0 =A0:private_addresses=3D>[], >> =A0 =A0 =A0 :actions=3D> instance_actions_for( VM_STATES[computehash['ST= ATE'].text] ) >> =A0 =A0 } ) >> =A0 end >> -- >> 1.7.1 >> >> -- >> Daniel Molina >> Project Engineer >> OpenNebula - The Open Source Solution for Data Center Virtualization >> www.OpenNebula.org | dmolina@opennebula.org | @OpenNebula > --=20 Daniel Molina Project Engineer OpenNebula - The Open Source Solution for Data Center Virtualization www.OpenNebula.org | dmolina@opennebula.org | @OpenNebula