From e6de5d7d2e5e5d54b70f5cc62569b5ec3eb90b42 Mon Sep 17 00:00:00 2001 From: Frederick Cheung Date: Fri, 27 Dec 2013 10:37:31 +0000 Subject: [PATCH] [AWS|EC2] request_spot_instances.rb requires that date parameters be iso8601 --- lib/fog/aws/requests/compute/request_spot_instances.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/fog/aws/requests/compute/request_spot_instances.rb b/lib/fog/aws/requests/compute/request_spot_instances.rb index 2bfdf0c74..87b9f7da4 100644 --- a/lib/fog/aws/requests/compute/request_spot_instances.rb +++ b/lib/fog/aws/requests/compute/request_spot_instances.rb @@ -75,6 +75,14 @@ module Fog options['LaunchSpecification.UserData'] = Base64.encode64(options['LaunchSpecification.UserData']) end + if options['ValidFrom'] && options['ValidFrom'].is_a?(Time) + options['ValidFrom'] = options['ValidFrom'].iso8601 + end + + if options['ValidUntil'] && options['ValidUntil'].is_a?(Time) + options['ValidUntil'] = options['ValidUntil'].iso8601 + end + request({ 'Action' => 'RequestSpotInstances', 'LaunchSpecification.ImageId' => image_id,