From a30c6c9970bfde63cee721e10c405ffd5db85bf9 Mon Sep 17 00:00:00 2001 From: Aaron Suggs Date: Wed, 18 May 2011 14:37:44 -0400 Subject: [PATCH] [compute|aws] Mock get_password_data request --- lib/fog/compute/requests/aws/get_password_data.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/fog/compute/requests/aws/get_password_data.rb b/lib/fog/compute/requests/aws/get_password_data.rb index 30ca950c6..8a6298a0b 100644 --- a/lib/fog/compute/requests/aws/get_password_data.rb +++ b/lib/fog/compute/requests/aws/get_password_data.rb @@ -33,7 +33,19 @@ module Fog class Mock def get_password_data(instance_id) - Fog::Mock.not_implemented + response = Excon::Response.new + if instance = @data[:instances][instance_id] + response.status = 200 + response.body = { + 'instanceId' => instance_id, + 'passwordData' => nil, + 'requestId' => Fog::AWS::Mock.request_id, + 'timestamp' => Time.now + } + response + else; + raise Fog::AWS::Compute::NotFound.new("The instance ID '#{instance_id}' does not exist") + end end end