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 2011/10/06 15:01:59 UTC

[PATCH core 1/2] RHEV-M: Disabled 'start' action when instance is in 'pending' state

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


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

diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
index 1fa6121..7ee953a 100644
--- a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
+++ b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
@@ -64,7 +64,6 @@ class RHEVMDriver < Deltacloud::BaseDriver
 
   define_instance_states do
     start.to( :pending )          .automatically
-    pending.to( :running )        .on( :start )
     pending.to( :stopped )        .automatically
     stopped.to( :running )        .on( :start )
     running.to( :stopping )       .on( :stop )
-- 
1.7.4.4


Re: [PATCH core 2/2] Rabbit: New Sinatra (1.3.0) has support for OPTIONS helper. So monkey patching is not needed there anymore

Posted by "marios@redhat.com" <ma...@redhat.com>.
ACK  ... this is a very nice, as yet undocumented feature (we should 
remedy this as soon as the new site docs go up)

e.g. for rhevm driver:
=========
request:

curl -iv -X OPTIONS --user "user:password" 
http://localhost:3001/api/instances?format=xml

=========
response:

HTTP/1.1 200 OK
Content-Type: text/html;charset=utf-8
Date: Thu, 06 Oct 2011 13:49:42 GMT
X-Runtime: 0.002646
Content-Length: 0
Server: Apache-Deltacloud/0.4.1
X-Operations-Allowed: destroy,show,run,start,reboot,create,stop,index,new


marios

On 06/10/11 16:02, mfojtik@redhat.com wrote:
> From: Michal Fojtik<mf...@redhat.com>
>
>
> Signed-off-by: Michal fojtik<mf...@redhat.com>
> ---
>   server/lib/sinatra/rabbit.rb |   13 ++++++++-----
>   1 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/server/lib/sinatra/rabbit.rb b/server/lib/sinatra/rabbit.rb
> index 00bd075..e83d5a8 100644
> --- a/server/lib/sinatra/rabbit.rb
> +++ b/server/lib/sinatra/rabbit.rb
> @@ -423,11 +423,14 @@ module Sinatra
>     helpers RabbitHelper
>   end
>
> -configure do
> -  class<<  Sinatra::Base
> -    def options(path, opts={},&block)
> -      route 'OPTIONS', path, opts,&block
> +# In Sinatra<  1.2 there was no helper to create OPTIONS route
> +unless Sinatra::Base.respond_to? :options
> +  configure do
> +    class<<  Sinatra::Base
> +      def options(path, opts={},&block)
> +        route 'OPTIONS', path, opts,&block
> +      end
>       end
> +    Sinatra::Delegator.delegate :options
>     end
> -  Sinatra::Delegator.delegate :options
>   end


[PATCH core 2/2] Rabbit: New Sinatra (1.3.0) has support for OPTIONS helper. So monkey patching is not needed there anymore

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


Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 server/lib/sinatra/rabbit.rb |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/server/lib/sinatra/rabbit.rb b/server/lib/sinatra/rabbit.rb
index 00bd075..e83d5a8 100644
--- a/server/lib/sinatra/rabbit.rb
+++ b/server/lib/sinatra/rabbit.rb
@@ -423,11 +423,14 @@ module Sinatra
   helpers RabbitHelper
 end
 
-configure do
-  class << Sinatra::Base
-    def options(path, opts={}, &block)
-      route 'OPTIONS', path, opts, &block
+# In Sinatra < 1.2 there was no helper to create OPTIONS route
+unless Sinatra::Base.respond_to? :options
+  configure do
+    class << Sinatra::Base
+      def options(path, opts={}, &block)
+        route 'OPTIONS', path, opts, &block
+      end
     end
+    Sinatra::Delegator.delegate :options
   end
-  Sinatra::Delegator.delegate :options
 end
-- 
1.7.4.4


Re: [PATCH core 1/2] RHEV-M: Disabled 'start' action when instance is in 'pending' state

Posted by "marios@redhat.com" <ma...@redhat.com>.
ACK - started an instance, it went into 'STOPPED'. Then I started it 
succesfully.

On 06/10/11 16:01, mfojtik@redhat.com wrote:
> From: Michal Fojtik<mf...@redhat.com>
>
>
> Signed-off-by: Michal fojtik<mf...@redhat.com>
> ---
>   .../lib/deltacloud/drivers/rhevm/rhevm_driver.rb   |    1 -
>   1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
> index 1fa6121..7ee953a 100644
> --- a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
> +++ b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
> @@ -64,7 +64,6 @@ class RHEVMDriver<  Deltacloud::BaseDriver
>
>     define_instance_states do
>       start.to( :pending )          .automatically
> -    pending.to( :running )        .on( :start )
>       pending.to( :stopped )        .automatically
>       stopped.to( :running )        .on( :start )
>       running.to( :stopping )       .on( :stop )