sorry i should have specified... the reason I am surprised is that I 
don't return an instance for these methods in the terremark driver and 
didn't come accross any problems using it with core (deltacloudd -i 
terremark). Having said that I think it does make sense that these 
methods would return an instance object (in fact I initially did this 
and then changed it to no return value after looking at other drivers),

marios



 >> Hi,


 > The *_instance methods are expected to return an instance
 > object from the individual drivers.  The ec2 driver was

 >> really? thats news to me... as I understand from
 >> http://deltacloud.org/framework.html the start/stop/reboot methods 
 >> "have no return value". Or has the API been changed?

 >> marios



On 07/05/10 16:42, Chris Lalancette wrote:
> The *_instance methods are expected to return an instance
> object from the individual drivers.  The ec2 driver was
> failing to do this, leading to stacktraces in the server.
> Fix this up by fetching the instance after an action.
>
> Signed-off-by: Chris Lalancette<[email protected]>
> ---
>   server/lib/deltacloud/drivers/ec2/ec2_driver.rb |    7 +++++++
>   1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb 
> b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> index 69356e2..e1e5bf2 100644
> --- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> +++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
> @@ -171,6 +171,9 @@ class EC2Driver<  Deltacloud::BaseDriver
>       safely do
>         ec2.reboot_instances( :instance_id =>  id )
>       end
> +
> +    this_instance = ec2.describe_instances( :instance_id =>  
> id).reservationSet.item.first.instancesSet.item.first
> +    convert_instance(this_instance, this_instance.ownerId)
>     end
>
>     def stop_instance(credentials, id)
> @@ -178,6 +181,8 @@ class EC2Driver<  Deltacloud::BaseDriver
>       safely do
>         ec2.terminate_instances( :instance_id =>  id )
>       end
> +    this_instance = ec2.describe_instances( :instance_id =>  
> id).reservationSet.item.first.instancesSet.item.first
> +    convert_instance(this_instance, this_instance.ownerId)
>     end
>
>     def destroy_instance(credentials, id)
> @@ -185,6 +190,8 @@ class EC2Driver<  Deltacloud::BaseDriver
>       safely do
>         ec2.terminate_instances( :instance_id =>  id )
>       end
> +    this_instance = ec2.describe_instances( :instance_id =>  
> id).reservationSet.item.first.instancesSet.item.first
> +    convert_instance(this_instance, this_instance.ownerId)
>     end
>
>     #

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to