1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/tests/requests/compute/helper.rb
Eddie Johnston 66187d73fb Fix Fog::Compute::AWS::Images#all
Calling #all fails with the error: `Excon::Error::Socket: 25:28: FATAL: Document is empty (Nokogiri::XML::SyntaxError)`. This was because of the parser not handling nil creationDate values:

```
when 'creationDate'
  @image[name] = Time.parse(value)
```

This commit ensures nil `creationDate` fields are not parsed.
2017-07-11 16:36:48 +01:00

27 lines
702 B
Ruby

class AWS
module Compute
module Formats
BASIC = {
'requestId' => String
}
DESCRIBE_IMAGES = BASIC.merge({
"imagesSet" => [{
"imageId" => String,
"imageLocation" => String,
"imageState" => String,
"imageOwnerId" => String,
"creationDate" => Fog::Nullable::String,
"isPublic" => Fog::Nullable::Boolean,
"architecture" => String,
"imageType" => String,
"imageOwnerAlias" => String,
"rootDeviceType" => String,
"blockDeviceMapping" => Array,
"virtualizationType" => String,
"hypervisor" => String
}]
})
end
end
end