-
Notifications
You must be signed in to change notification settings - Fork 24
Upgrade aws-sdk to v2 #32
base: 0.3.0
Are you sure you want to change the base?
Conversation
Hi @tatsuyafw ! Thank you for GREAT CONTRIBUTION !!!! I want to solve this, too. Could you check following point ? 1. Some test failIn my environment (using this ),
Could you check again ? 2. Very slowI ran the test, but I feel it is very slow.... See following output that use
How about in your environment ? |
Thank you for reply! First, this PR has conflicts, so I will fix that. Then I'll check the points you've mentioned. |
58d9690
to
d8a53a6
Compare
I've rebased this PR from latest
I find some tests are unstable... Sometimes all tests passed, and sometimes some tests failed on my machine.
Hmm, It's too slow... 😢
|
Thank you ! I'm looking forward to good news !
OK! It may only happen in my environment. Thank you !! |
I use rbtrace.gem.
I removed So, raise following error.
|
Sorry for my late reply, and thank you for more detail! I've fixed this NoMethodError, and confirmed that |
lib/piculet/exporter.rb
Outdated
:port_range => port_range, | ||
:ip_ranges => ip_ranges, | ||
:groups => ip_perm.user_id_group_pairs.map {|group| | ||
group = @ec2.security_groups.find { |g| g.id == group.group_id } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L61's group
and L63's group
is different.
And L61's group
may be nil
.
I try bundle exec bin/piculet -e
on my environment . So, raise following error.
[Aws::EC2::Client 200 0.186472 0 retries] describe_security_groups()
bundler: failed to load command: bin/piculet (bin/piculet)
NoMethodError: undefined method `group_id' for nil:NilClass
/Users/k1low/.ghq/github.com/codenize-tools/piculet/lib/piculet/exporter.rb:63:in `block (2 levels) in export_ip_permissions'
/Users/k1low/.ghq/github.com/codenize-tools/piculet/lib/piculet/exporter.rb:60:in `map'
/Users/k1low/.ghq/github.com/codenize-tools/piculet/lib/piculet/exporter.rb:60:in `block in export_ip_permissions'
/Users/k1low/.ghq/github.com/codenize-tools/piculet/lib/piculet/exporter.rb:51:in `map'
/Users/k1low/.ghq/github.com/codenize-tools/piculet/lib/piculet/exporter.rb:51:in `export_ip_permissions'
/Users/k1low/.ghq/github.com/codenize-tools/piculet/lib/piculet/exporter.rb:43:in `export_security_group'
/Users/k1low/.ghq/github.com/codenize-tools/piculet/lib/piculet/exporter.rb:30:in `block in export'
/Users/k1low/.ghq/github.com/codenize-tools/piculet/lib/piculet/exporter.rb:22:in `each'
/Users/k1low/.ghq/github.com/codenize-tools/piculet/lib/piculet/exporter.rb:22:in `export'
/Users/k1low/.ghq/github.com/codenize-tools/piculet/lib/piculet/exporter.rb:5:in `export'
/Users/k1low/.ghq/github.com/codenize-tools/piculet/lib/piculet/client.rb:41:in `export'
bin/piculet:182:in `<top (required)>'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review!
I cannot immediately come up with why @ec2.security_groups.find { |g| g.id == group.group_id }
returns nil
, so I try to search the cause.
BTW, I added the L61 @ec2.security_groups.find { |g| g.id == group.group_id }
to fetch group.group_name
info. Because ip_perm.user_id_group_pair
's group (L60) has always no information about group_name
as below.
57: :protocol => ip_protocol,
58: :port_range => port_range,
59: :ip_ranges => ip_ranges,
60: :groups => ip_perm.user_id_group_pairs.map {|group|
61: require 'pry'
=> 62: binding.pry
63: group = @ec2.security_groups.find { |g| g.id == group.group_id }
64: {
65: :id => group.group_id,
66: :name => group.group_name,
67: :owner_id => group.owner_id,
[1] 2.4.1-p111(#<Piculet::Exporter>)> group
=> #<struct Aws::EC2::Types::UserIdGroupPair
description=nil,
group_id="sg-xxx",
group_name=nil, # here!
peering_status=nil,
user_id="752xxxxxxxxx",
vpc_id=nil,
vpc_peering_connection_id=nil>
[2] 2.4.1-p111(#<Piculet::Exporter>)>
Sorry for my late reply... Could you try running |
Hi!
This PR upgrades aws-sdk to v2.
I have tested with my personal AWS account, and all specs passed.