Permalink
Browse files

[FIX] adding check for aws-sdk

  • Loading branch information...
1 parent 9c9ccd0 commit a99a5a88a929b3841a4c4388e3860707388d90eb Tom Caspy committed Mar 8, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/rpm_contrib/instrumentation/aws.rb
@@ -13,8 +13,14 @@
executes do
# Instrument connections to the AWS-S3 service
- ::AWS::S3::Connection::Management::ClassMethods.module_eval do
- add_method_tracer :establish_connection!, 'AWS-S3/establish_connection!'
+ if defined?(::AWS::S3::Connection)
+ ::AWS::S3::Connection::Management::ClassMethods.module_eval do
+ add_method_tracer :establish_connection!, 'AWS-S3/establish_connection!'
+ end
+ else #using aws-sdk
+ ::AWS::S3.class_eval do
+ add_method_tracer :initialize, 'AWS-S3/establish_connection!'
+ end
end
# Instrument methods on Bucket

0 comments on commit a99a5a8

Please sign in to comment.