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

Aws::IAM::Policy.versions goes asplodey. #879

Closed
MrJoy opened this issue Jul 22, 2015 · 1 comment
Closed

Aws::IAM::Policy.versions goes asplodey. #879

MrJoy opened this issue Jul 22, 2015 · 1 comment

Comments

@MrJoy
Copy link

MrJoy commented Jul 22, 2015

ERROR: NoMethodError: undefined method `each' for #<Seahorse::Client::Response:0x007fbdfae46960>
ERROR:   /Users/jfrisby/.rvm/gems/ruby-2.1.5@cnc-renbot/gems/aws-sdk-core-2.1.7/lib/seahorse/client/response.rb:81:in `method_missing'
ERROR:   /Users/jfrisby/.rvm/gems/ruby-2.1.5@cnc-renbot/gems/aws-sdk-resources-2.1.7/lib/aws-sdk-resources/operations.rb:127:in `all_batches'
ERROR:   /Users/jfrisby/.rvm/gems/ruby-2.1.5@cnc-renbot/gems/aws-sdk-resources-2.1.7/lib/aws-sdk-resources/collection.rb:18:in `each'
ERROR:   /Users/jfrisby/.rvm/gems/ruby-2.1.5@cnc-renbot/gems/aws-sdk-resources-2.1.7/lib/aws-sdk-resources/collection.rb:18:in `each'

(Thereafter in the stack trace is my code / other code I'm using.)

I'd swear this was working fine and broke in the vicinity of when we updated to... 2.1.0-ish? (we updated on 6/18...)

Our relevant code looks a bit like so:

iam         = Aws::IAM::Resource.new(credentials: cred,
                                     region:      ENV.fetch("AWS_REGION"))
policies    = iam.policies(scope: "Local").to_a
# ...
policy      = policies.find { |pp| pp.policy_name == name }
versions    = policy.versions # <-- This goes boom.
@trevorrowe
Copy link
Member

I've added the missing paginator for Aws::IAM::Client#list_policy_versions which should stop this from raising. This fix should be released shortly. Thanks for reporting the issue!

@srchase srchase added the bug label Dec 24, 2018
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

No branches or pull requests

3 participants