Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Fog::Compute::AWS::Images#all #375

Merged
merged 1 commit into from
Jul 18, 2017
Merged

Conversation

eddiej
Copy link
Contributor

@eddiej eddiej commented Jul 6, 2017

Calling Fog::Compute::AWS::Images#all fails with the error: Excon::Error::Socket: 25:28: FATAL: Document is empty (Nokogiri::XML::SyntaxError).

This was because the parser was calling Time.parse on nil creationDate values:

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

This commit ensures nil or blank creationDate fields are not parsed. It also adds a test for Fog::Parsers::Compute::AWS::DescribeImages which wasn't present before.

Fixes #273.

Copy link
Member

@lanej lanej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -75,7 +75,7 @@ def end_element(name)
@image[name] = false
end
when 'creationDate'
@image[name] = Time.parse(value)
@image[name] = Time.parse(value) if value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check for a blank value ("" or nil) for the sake of Jruby.

@geemus
Copy link
Member

geemus commented Jul 10, 2017 via email

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.
@eddiej
Copy link
Contributor Author

eddiej commented Jul 12, 2017

Changes made to accommodate Jruby. Tests passing.

@lanej lanej merged commit 5c3f8f4 into fog:master Jul 18, 2017
@lanej
Copy link
Member

lanej commented Jul 18, 2017

Thanks @eddiej

@geemus
Copy link
Member

geemus commented Jul 24, 2017 via email

@eddiej eddiej deleted the ej-fix-describe-images branch August 2, 2017 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants