Return-Path: Delivered-To: apmail-incubator-deltacloud-commits-archive@minotaur.apache.org Received: (qmail 24654 invoked from network); 8 Jul 2010 23:30:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Jul 2010 23:30:30 -0000 Received: (qmail 67179 invoked by uid 500); 8 Jul 2010 23:30:30 -0000 Delivered-To: apmail-incubator-deltacloud-commits-archive@incubator.apache.org Received: (qmail 67157 invoked by uid 500); 8 Jul 2010 23:30:30 -0000 Mailing-List: contact deltacloud-commits-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-commits@incubator.apache.org Received: (qmail 67150 invoked by uid 99); 8 Jul 2010 23:30:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jul 2010 23:30:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jul 2010 23:30:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BE6662388A2C; Thu, 8 Jul 2010 23:29:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r962157 - in /incubator/deltacloud/trunk: client/Rakefile client/specs/instance_states_spec.rb server/lib/deltacloud/base_driver.rb Date: Thu, 08 Jul 2010 23:29:29 -0000 To: deltacloud-commits@incubator.apache.org From: lutter@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100708232929.BE6662388A2C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: lutter Date: Thu Jul 8 23:29:29 2010 New Revision: 962157 URL: http://svn.apache.org/viewvc?rev=962157&view=rev Log: Push FSM changes further to instance-related representations that use it. Modified: incubator/deltacloud/trunk/client/Rakefile incubator/deltacloud/trunk/client/specs/instance_states_spec.rb incubator/deltacloud/trunk/server/lib/deltacloud/base_driver.rb Modified: incubator/deltacloud/trunk/client/Rakefile URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/Rakefile?rev=962157&r1=962156&r2=962157&view=diff ============================================================================== --- incubator/deltacloud/trunk/client/Rakefile (original) +++ incubator/deltacloud/trunk/client/Rakefile Thu Jul 8 23:29:29 2010 @@ -22,6 +22,9 @@ require 'spec/rake/spectask' desc "Run all examples" Spec::Rake::SpecTask.new('spec') do |t| t.spec_files = FileList['specs/**/*_spec.rb'] + t.spec_opts = [ + '--format html:spec_report.html' + ] end desc "Setup Fixtures" Modified: incubator/deltacloud/trunk/client/specs/instance_states_spec.rb URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/specs/instance_states_spec.rb?rev=962157&r1=962156&r2=962157&view=diff ============================================================================== --- incubator/deltacloud/trunk/client/specs/instance_states_spec.rb (original) +++ incubator/deltacloud/trunk/client/specs/instance_states_spec.rb Thu Jul 8 23:29:29 2010 @@ -37,7 +37,7 @@ describe "instance-states" do instance_states.should_not be_nil instance_states.should_not be_empty - instance_states[0].name.should eql( 'begin' ) + instance_states[0].name.should eql( 'start' ) instance_states[0].transitions.size.should eql( 1 ) instance_states[0].transitions[0].should_not be_auto Modified: incubator/deltacloud/trunk/server/lib/deltacloud/base_driver.rb URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/base_driver.rb?rev=962157&r1=962156&r2=962157&view=diff ============================================================================== --- incubator/deltacloud/trunk/server/lib/deltacloud/base_driver.rb (original) +++ incubator/deltacloud/trunk/server/lib/deltacloud/base_driver.rb Thu Jul 8 23:29:29 2010 @@ -39,11 +39,11 @@ module Deltacloud def instance_actions_for(state) actions = [] state_key = state.downcase.to_sym - states = instance_states() - current_state = states.find{|e| e.first == state.downcase.to_sym } + states = instance_state_machine.states() + current_state = states.find{|e| e.name == state.underscore.to_sym } if ( current_state ) - actions = current_state.last.values.uniq - actions.reject!{|e| e == :_auto_} + actions = current_state.transitions.collect{|e|e.action} + actions.reject!{|e| e.nil?} end actions end