Return-Path: Delivered-To: apmail-incubator-deltacloud-dev-archive@minotaur.apache.org Received: (qmail 79876 invoked from network); 9 Dec 2010 14:41:10 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Dec 2010 14:41:10 -0000 Received: (qmail 20254 invoked by uid 500); 9 Dec 2010 14:41:10 -0000 Delivered-To: apmail-incubator-deltacloud-dev-archive@incubator.apache.org Received: (qmail 20194 invoked by uid 500); 9 Dec 2010 14:41:10 -0000 Mailing-List: contact deltacloud-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltacloud-dev@incubator.apache.org Delivered-To: mailing list deltacloud-dev@incubator.apache.org Received: (qmail 20185 invoked by uid 99); 9 Dec 2010 14:41:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Dec 2010 14:41:10 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mfojtik@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Dec 2010 14:41:03 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB9EegUj022808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Dec 2010 09:40:42 -0500 Received: from patashnik.brq.redhat.com (dhcp-2-138.brq.redhat.com [10.34.2.138]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oB9Eea4v021851 for ; Thu, 9 Dec 2010 09:40:42 -0500 From: mfojtik@redhat.com To: deltacloud-dev@incubator.apache.org Subject: [PATCH core 5/6] Fixed server.rb to produce output for Hardware profile in same way as we do with other collections Date: Thu, 9 Dec 2010 15:40:34 +0100 Message-Id: <1291905635-9478-6-git-send-email-mfojtik@redhat.com> In-Reply-To: <1291905635-9478-1-git-send-email-mfojtik@redhat.com> References: <1291905635-9478-1-git-send-email-mfojtik@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 From: Michal Fojtik --- server/server.rb | 24 +++--------------------- 1 files changed, 3 insertions(+), 21 deletions(-) diff --git a/server/server.rb b/server/server.rb index 9585f9b..d873aba 100644 --- a/server/server.rb +++ b/server/server.rb @@ -318,7 +318,7 @@ END format.xml do response.status = 201 # Created response['Location'] = instance_url(instance.id) - @instance = instance + @instance, @element = instance, instance haml :"instances/show" end format.html do @@ -371,32 +371,14 @@ END with_capability :hardware_profiles param :id, :string param :architecture, :string, :optional, [ 'i386', 'x86_64' ] - control do - @profiles = driver.hardware_profiles(credentials, params) - respond_to do |format| - format.xml { haml :'hardware_profiles/index' } - format.html { haml :'hardware_profiles/index' } - format.json { convert_to_json(:hardware_profile, @profiles) } - end - end + control { filter_all(:hardware_profiles) } end operation :show do description "Show specific hardware profile." with_capability :hardware_profile param :id, :string, :required - control do - @profile = driver.hardware_profile(credentials, params[:id]) - if @profile - respond_to do |format| - format.xml { haml :'hardware_profiles/show', :layout => false } - format.html { haml :'hardware_profiles/show' } - format.json { convert_to_json(:hardware_profile, @profile) } - end - else - report_error(404, 'not_found') - end - end + control { show ( :hardware_profile ) } end end -- 1.7.3.2