Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Resource#wait_until_running crashes #210

Closed
olefriis opened this issue Feb 9, 2015 · 4 comments
Closed

Resource#wait_until_running crashes #210

olefriis opened this issue Feb 9, 2015 · 4 comments

Comments

@olefriis
Copy link

olefriis commented Feb 9, 2015

Code:

require 'aws-sdk'

ec2 = Aws::EC2::Client.new(region: 'eu-west-1', credentials: Aws::Credentials.new(secret, even_more_secret))

resource = Aws::EC2::Resource.new(client: ec2)
instance = resource.create_instances(
  min_count: 1,
  max_count: 1,
  image_id: my_image_id,
  key_name: my_key_name,
  instance_type: 'm3.medium',
  security_group_ids: [my_security_group_id],
  subnet_id: my_subnet_id
).first
puts "booting..."
instance.wait_until_running

Works fine in 2.0.18.pre and previous pre-releases I've tried out.

Does not work in 2.0.19.pre all the way up to and including 2.0.22. After outputting "booting...", it seems like the script actually waits correctly for the running state, but then crashes:

booting...
/Users/olefriis/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-resources-2.0.20.pre/lib/aws-sdk-resources/operations.rb:217:in `call': undefined method `data' for true:TrueClass (NoMethodError)
    from /Users/olefriis/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-resources-2.0.20.pre/lib/aws-sdk-resources/operation_methods.rb:19:in `block in add_operation'
    from aws-bug.rb:16:in `<main>'
@trevorrowe
Copy link
Contributor

Thank you for reporting this issue. This regression seems to have come from a change when upgrading from waiters v1 to waiters v2. I've patched aws-sdk-core so that Client#wait_until has the same response format as it did before the update. I will try to get this fix released tomorrow.

@trevorrowe
Copy link
Contributor

Closed by aws/aws-sdk-ruby@fba620d

@olefriis
Copy link
Author

Wow, that was fast. Thanks a bunch!

@trevorrowe
Copy link
Contributor

The fix is live now with version 2.0.23

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants