fog-aws 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30d84e3705aeee14d91a9c82f15fb312a5f4c639
4
- data.tar.gz: c0ad1b0157cdf4f1d5afc87e0db4abc1e1f33e64
3
+ metadata.gz: 63e0bc6ed8840b40f95208a3254e449f22cf295e
4
+ data.tar.gz: 566b518ff636d7b6f2e2572da30a1959155c0da7
5
5
  SHA512:
6
- metadata.gz: 43f3f056697c6d3407f6c4f0f7f6bc1ab0b7b50f01118a16fb7e095965da5d04edf044a01b8931c4b3c60c8cb8f00744b53160330ccaa3e190a20a5228e4a4e4
7
- data.tar.gz: c5305530afe5c59a43f8cc93cfe9e0ab4cdbd6bdc6037a5b2790deff609ebdeb6a220a7aa1f48eb6c1b7f020e163098bc6ba586160dcb06cb52de2bb353f8dd6
6
+ metadata.gz: e9445b6c2d33ad2d37476237fe18c4637a59d4b7179e60ab90403a172b4a36945dc394ea6dce655261cbc07c9db7d3412bd7a078a4b9d8377804b8c4914f00bf
7
+ data.tar.gz: 036d202d04d82ac75435c2b3267d7d6909646ebccdc7058839a096fab118d8b5fd2303cee2b4811d6c2eb80e85983a7edf12dc8187c8c99de9467d7f0560bbeb
data/Gemfile CHANGED
@@ -2,6 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in fog-aws.gemspec
4
4
  gemspec
5
-
6
5
  gem 'pry-nav', group: :test
7
6
  gem "codeclimate-test-reporter", group: :test, require: nil
@@ -10,8 +10,8 @@ module Fog
10
10
 
11
11
  # Creates a new scaling policy.
12
12
  def initialize(attributes={})
13
- self.filters = attributes
14
- super(attributes)
13
+ self.filters ||= {}
14
+ super
15
15
  end
16
16
 
17
17
  def all(filters_arg = filters)
@@ -22,7 +22,8 @@ module Fog
22
22
  attribute :user_data, :aliases => 'UserData'
23
23
  attribute :spot_price, :aliases => 'SpotPrice'
24
24
  attribute :placement_tenancy, :aliases => 'PlacementTenancy'
25
-
25
+ attribute :classic_link_vpc_id, :aliases => 'ClassicLinkVPCId'
26
+ attribute :classic_link_security_groups, :aliases => 'ClassicLinkVPCSecurityGroups'
26
27
 
27
28
  def initialize(attributes={})
28
29
  #attributes[:availability_zones] ||= %w(us-east-1a us-east-1b us-east-1c us-east-1d)
@@ -42,19 +42,8 @@ module Fog
42
42
 
43
43
  def activities
44
44
  requires :id
45
- data = []
46
- next_token = nil
47
- loop do
48
- result = service.describe_scaling_activities('AutoScalingGroupName' => id, 'NextToken' => next_token).body['DescribeScalingActivitiesResult']
49
- data += result['Activities']
50
- next_token = result['NextToken']
51
- break if next_token.nil?
52
- end
53
- Fog::AWS::AutoScaling::Activities.new({
54
- :data => data,
55
- :service => service,
56
- #:load_balancer => self
57
- })
45
+
46
+ activities = Fog::AWS::AutoScaling::Activities.new(:service => service, :filters => {'AutoScalingGroupName' => id})
58
47
  end
59
48
 
60
49
  def configuration
@@ -12,7 +12,7 @@ module Fog
12
12
  end
13
13
 
14
14
  def reset_launch_configuration
15
- @launch_configuration = { 'BlockDeviceMappings' => [], 'InstanceMonitoring' => {}, 'SecurityGroups' => [] }
15
+ @launch_configuration = { 'BlockDeviceMappings' => [], 'InstanceMonitoring' => {}, 'SecurityGroups' => [], 'ClassicLinkVPCSecurityGroups' => []}
16
16
  end
17
17
 
18
18
  def reset_block_device_mapping
@@ -30,6 +30,8 @@ module Fog
30
30
  @in_block_device_mappings = true
31
31
  when 'SecurityGroups'
32
32
  @in_security_groups = true
33
+ when 'ClassicLinkVPCSecurityGroups'
34
+ @in_classic_link_security_groups = true
33
35
  end
34
36
  end
35
37
 
@@ -41,6 +43,8 @@ module Fog
41
43
  reset_block_device_mapping
42
44
  elsif @in_security_groups
43
45
  @launch_configuration['SecurityGroups'] << value
46
+ elsif @in_classic_link_security_groups
47
+ @launch_configuration['ClassicLinkVPCSecurityGroups'] << value
44
48
  else
45
49
  @results['LaunchConfigurations'] << @launch_configuration
46
50
  reset_launch_configuration
@@ -49,7 +53,7 @@ module Fog
49
53
  when 'DeviceName', 'VirtualName'
50
54
  @block_device_mapping[name] = value
51
55
 
52
- when 'SnapshotId', 'VolumeSize'
56
+ when 'SnapshotId', 'VolumeSize', 'VolumeType', 'Iops'
53
57
  @ebs[name] = value
54
58
  when 'Ebs'
55
59
  @block_device_mapping[name] = @ebs
@@ -62,11 +66,11 @@ module Fog
62
66
  @launch_configuration[name] = Time.parse(value)
63
67
  when 'ImageId', 'InstanceType', 'KeyName'
64
68
  @launch_configuration[name] = value
65
- when 'LaunchConfigurationARN', 'LaunchConfigurationName'
69
+ when 'LaunchConfigurationARN', 'LaunchConfigurationName', 'ClassicLinkVPCId'
66
70
  @launch_configuration[name] = value
67
71
  when 'KernelId', 'RamdiskId', 'UserData'
68
72
  @launch_configuration[name] = value
69
- when 'IamInstanceProfile'
73
+ when 'IamInstanceProfile', 'PlacementTenancy'
70
74
  @launch_configuration[name] = value
71
75
  when 'SpotPrice'
72
76
  @launch_configuration[name] = value.to_f
@@ -79,7 +83,8 @@ module Fog
79
83
  @in_launch_configurations = false
80
84
  when 'SecurityGroups'
81
85
  @in_security_groups = false
82
-
86
+ when 'ClassicLinkVPCSecurityGroups'
87
+ @in_classic_link_security_groups = false
83
88
  when 'NextToken'
84
89
  @results[name] = value
85
90
 
@@ -64,6 +64,11 @@ module Fog
64
64
  if security_groups = options.delete('SecurityGroups')
65
65
  options.merge!(AWS.indexed_param('SecurityGroups.member.%d', [*security_groups]))
66
66
  end
67
+
68
+ if classic_link_groups = options.delete('ClassicLinkVPCSecurityGroups')
69
+ options.merge!(AWS.indexed_param('ClassicLinkVPCSecurityGroups.member.%d', [*classic_link_groups]))
70
+ end
71
+
67
72
  if options['UserData']
68
73
  options['UserData'] = Base64.encode64(options['UserData'])
69
74
  end
@@ -141,6 +141,7 @@ module Fog
141
141
  body = %Q{<?xml version="1.0" encoding="UTF-8"?><ChangeResourceRecordSetsRequest xmlns="https://route53.amazonaws.com/doc/#{@version}/">#{changes}</ChangeResourceRecordSetsRequest>}
142
142
  request({
143
143
  :body => body,
144
+ :idempotent => true,
144
145
  :parser => Fog::Parsers::DNS::AWS::ChangeResourceRecordSets.new,
145
146
  :expects => 200,
146
147
  :method => 'POST',
@@ -27,8 +27,9 @@ module Fog
27
27
 
28
28
  request({
29
29
  :expects => 200,
30
- :parser => Fog::Parsers::DNS::AWS::GetHostedZone.new,
30
+ :idempotent => true,
31
31
  :method => 'GET',
32
+ :parser => Fog::Parsers::DNS::AWS::GetHostedZone.new,
32
33
  :path => "hostedzone/#{zone_id}"
33
34
  })
34
35
  end
@@ -48,11 +48,12 @@ module Fog
48
48
  end
49
49
 
50
50
  request({
51
- :query => parameters,
52
- :parser => Fog::Parsers::DNS::AWS::ListResourceRecordSets.new,
53
51
  :expects => 200,
52
+ :idempotent => true,
54
53
  :method => 'GET',
55
- :path => "hostedzone/#{zone_id}/rrset"
54
+ :parser => Fog::Parsers::DNS::AWS::ListResourceRecordSets.new,
55
+ :path => "hostedzone/#{zone_id}/rrset",
56
+ :query => parameters
56
57
  })
57
58
  end
58
59
  end
@@ -27,6 +27,23 @@ module Fog
27
27
  )
28
28
  end
29
29
  end
30
+
31
+ class Mock
32
+ def delete_group_policy(group_name, policy_name)
33
+ if !data[:groups].key? group_name
34
+ raise Fog::AWS::IAM::NotFound.new("The group with name #{group_name} cannot be found.")
35
+ elsif !data[:groups][group_name][:policies].key? policy_name
36
+ raise Fog::AWS::IAM::NotFound.new("The group policy with name #{policy_name} cannot be found.")
37
+ else
38
+ data[:groups][group_name][:policies].delete(policy_name)
39
+
40
+ Excon::Response.new.tap do |response|
41
+ response.body = { 'RequestId' => Fog::AWS::Mock.request_id }
42
+ response.status = 200
43
+ end
44
+ end
45
+ end
46
+ end
30
47
  end
31
48
  end
32
49
  end
@@ -33,29 +33,29 @@ module Fog
33
33
 
34
34
  source = self.data[:servers][source_identifier]
35
35
  data = {
36
- 'AllocatedStorage' => source['AllocatedStorage'],
37
- 'AutoMinorVersionUpgrade' => options.key?('AutoMinorVersionUpgrade') ? options['AutoMinorVersionUpgrade'] : true,
38
- 'AvailabilityZone' => options['AvailabilityZone'],
39
- 'DBInstanceClass' => options['DBInstanceClass'] || 'db.m1.small',
40
- 'DBInstanceIdentifier' => instance_identifier,
41
- 'DBInstanceStatus' => 'creating',
42
- 'DBName' => source['DBName'],
43
- 'DBParameterGroups' => source['DBParameterGroups'],
44
- 'DBSecurityGroups' => source['DBSecurityGroups'],
45
- 'Endpoint' => {},
46
- 'Engine' => source['Engine'],
47
- 'EngineVersion' => options['EngineVersion'] || '5.5.12',
48
- 'InstanceCreateTime' => nil,
49
- 'Iops' => source['Iops'],
50
- 'LatestRestorableTime' => nil,
51
- 'LicenseModel' => 'general-public-license',
52
- 'MasterUsername' => source['MasterUsername'],
53
- 'MultiAZ' => false,
54
- 'PendingModifiedValues' => {},
55
- 'PreferredBackupWindow'=> '08:00-08:30',
56
- 'PreferredMaintenanceWindow'=> "mon:04:30-mon:05:00",
57
- 'ReadReplicaDBInstanceIdentifiers'=> [],
58
- 'ReadReplicaSourceDBInstanceIdentifier'=> source_identifier
36
+ 'AllocatedStorage' => source['AllocatedStorage'],
37
+ 'AutoMinorVersionUpgrade' => options.key?('AutoMinorVersionUpgrade') ? options['AutoMinorVersionUpgrade'] : true,
38
+ 'AvailabilityZone' => options['AvailabilityZone'],
39
+ 'DBInstanceClass' => options['DBInstanceClass'] || 'db.m1.small',
40
+ 'DBInstanceIdentifier' => instance_identifier,
41
+ 'DBInstanceStatus' => 'creating',
42
+ 'DBName' => source['DBName'],
43
+ 'DBParameterGroups' => source['DBParameterGroups'],
44
+ 'DBSecurityGroups' => source['DBSecurityGroups'],
45
+ 'Endpoint' => {},
46
+ 'Engine' => source['Engine'],
47
+ 'EngineVersion' => source['EngineVersion'],
48
+ 'InstanceCreateTime' => nil,
49
+ 'Iops' => source['Iops'],
50
+ 'LatestRestorableTime' => nil,
51
+ 'LicenseModel' => 'general-public-license',
52
+ 'MasterUsername' => source['MasterUsername'],
53
+ 'MultiAZ' => false,
54
+ 'PendingModifiedValues' => {},
55
+ 'PreferredBackupWindow' => '08:00-08:30',
56
+ 'PreferredMaintenanceWindow' => "mon:04:30-mon:05:00",
57
+ 'ReadReplicaDBInstanceIdentifiers' => [],
58
+ 'ReadReplicaSourceDBInstanceIdentifier' => source_identifier
59
59
  }
60
60
  self.data[:servers][instance_identifier] = data
61
61
  self.data[:servers][source_identifier]['ReadReplicaDBInstanceIdentifiers'] << instance_identifier
@@ -21,6 +21,21 @@ module Fog
21
21
  })
22
22
  end
23
23
  end
24
+
25
+ class Mock
26
+ def delete_bucket_policy(bucket_name)
27
+ if bucket = data[:buckets][bucket_name]
28
+ bucket[:policy] = nil
29
+
30
+ Excon::Response.new.tap do |response|
31
+ response.body = { 'RequestId' => Fog::AWS::Mock.request_id }
32
+ response.status = 200
33
+ end
34
+ else
35
+ raise Fog::AWS::IAM::NotFound.new("The bucket with name #{bucket_name} cannot be found.")
36
+ end
37
+ end
38
+ end
24
39
  end
25
40
  end
26
41
  end
@@ -20,6 +20,23 @@ module Fog
20
20
  })
21
21
  end
22
22
  end
23
+
24
+ class Mock
25
+ #FIXME: You can't actually use the credentials for anything elsewhere in Fog
26
+ #FIXME: Doesn't do any validation on the policy
27
+ def put_bucket_policy(bucket_name, policy)
28
+ if bucket = data[:buckets][bucket_name]
29
+ bucket[:policy] = policy
30
+
31
+ Excon::Response.new.tap do |response|
32
+ response.body = { 'RequestId' => Fog::AWS::Mock.request_id }
33
+ response.status = 200
34
+ end
35
+ else
36
+ raise Fog::AWS::IAM::NotFound.new("The bucket with name #{bucket_name} cannot be found.")
37
+ end
38
+ end
39
+ end
23
40
  end
24
41
  end
25
42
  end
@@ -141,9 +141,28 @@ module Fog
141
141
 
142
142
  def signed_url(params, expires)
143
143
  #convert expires from a point in time to a delta to now
144
+ expires = expires.to_i
145
+ if @signature_version == 4
146
+ params = v4_signed_params_for_url(params, expires)
147
+ else
148
+ params = v2_signed_params_for_url(params, expires)
149
+ end
150
+
151
+ params_to_url(params)
152
+ end
153
+
154
+ private
155
+
156
+ def validate_signature_version!
157
+ unless @signature_version == 2 || @signature_version == 4
158
+ raise "Unknown signature version #{@signature_version}; valid versions are 2 or 4"
159
+ end
160
+ end
161
+
162
+ def v4_signed_params_for_url(params, expires)
144
163
  now = Fog::Time.now
145
164
 
146
- expires = expires.to_i - now.to_i
165
+ expires = expires - now.to_i
147
166
  params[:headers] ||= {}
148
167
 
149
168
  params[:query]||= {}
@@ -157,14 +176,29 @@ module Fog
157
176
  params = request_params(params)
158
177
  params[:headers][:host] = params[:host]
159
178
 
160
- signature = @signer.signature_parameters(params, now, "UNSIGNED-PAYLOAD")
179
+ signature_query_params = @signer.signature_parameters(params, now, "UNSIGNED-PAYLOAD")
180
+ params[:query] = (params[:query] || {}).merge(signature_query_params)
181
+ params
182
+ end
161
183
 
162
- params[:query] = (params[:query] || {}).merge(signature)
184
+ def v2_signed_params_for_url(params, expires)
185
+ if @aws_session_token
186
+ params[:headers]||= {}
187
+ params[:headers]['x-amz-security-token'] = @aws_session_token
188
+ end
189
+ signature = signature_v2(params, expires)
163
190
 
164
- params_to_url(params)
165
- end
191
+ params = request_params(params)
166
192
 
167
- private
193
+ signature_query_params = {
194
+ 'AWSAccessKeyId' => @aws_access_key_id,
195
+ 'Signature' => signature,
196
+ 'Expires' => expires,
197
+ }
198
+ params[:query] = (params[:query] || {}).merge(signature_query_params)
199
+ params[:query]['x-amz-security-token'] = @aws_session_token if @aws_session_token
200
+ params
201
+ end
168
202
 
169
203
  def region_to_host(region=nil)
170
204
  case region.to_s
@@ -365,18 +399,24 @@ module Fog
365
399
 
366
400
  def initialize(options={})
367
401
  @use_iam_profile = options[:use_iam_profile]
402
+
403
+ @region = options[:region] || DEFAULT_REGION
404
+
368
405
  if @endpoint = options[:endpoint]
369
406
  endpoint = URI.parse(@endpoint)
370
407
  @host = endpoint.host
371
408
  @scheme = endpoint.scheme
372
409
  @port = endpoint.port
373
410
  else
374
- @region = options[:region] || DEFAULT_REGION
375
411
  @host = options[:host] || region_to_host(@region)
376
412
  @scheme = options[:scheme] || DEFAULT_SCHEME
377
413
  @port = options[:port] || DEFAULT_SCHEME_PORT[@scheme]
378
414
  end
415
+
416
+
379
417
  @path_style = options[:path_style] || false
418
+ @signature_version = options.fetch(:aws_signature_version, 4)
419
+ validate_signature_version!
380
420
  setup_credentials(options)
381
421
  end
382
422
 
@@ -396,6 +436,11 @@ module Fog
396
436
 
397
437
  @signer = Fog::AWS::SignatureV4.new( @aws_access_key_id, @aws_secret_access_key, @region, 's3')
398
438
  end
439
+
440
+ def signature_v2(params, expires)
441
+ 'foo'
442
+ end
443
+
399
444
  end
400
445
 
401
446
  class Real
@@ -430,13 +475,14 @@ module Fog
430
475
  validate_signature_version!
431
476
  @path_style = options[:path_style] || false
432
477
 
478
+ @region = options[:region] || DEFAULT_REGION
479
+
433
480
  if @endpoint = options[:endpoint]
434
481
  endpoint = URI.parse(@endpoint)
435
482
  @host = endpoint.host
436
483
  @scheme = endpoint.scheme
437
484
  @port = endpoint.port
438
485
  else
439
- @region = options[:region] || DEFAULT_REGION
440
486
  @host = options[:host] || region_to_host(@region)
441
487
  @scheme = options[:scheme] || DEFAULT_SCHEME
442
488
  @port = options[:port] || DEFAULT_SCHEME_PORT[@scheme]
@@ -451,11 +497,6 @@ module Fog
451
497
 
452
498
  private
453
499
 
454
- def validate_signature_version!
455
- unless @signature_version == 2 || @signature_version == 4
456
- raise "Unknown signature version #{@signature_version}; valid versions are 2 or 4"
457
- end
458
- end
459
500
 
460
501
  def setup_credentials(options)
461
502
  @aws_access_key_id = options[:aws_access_key_id]
@@ -554,7 +595,7 @@ module Fog
554
595
  new_params[:bucket_name] = %r{<Bucket>([^<]*)</Bucket>}.match(body).captures.first
555
596
  new_params[:host] = %r{<Endpoint>([^<]*)</Endpoint>}.match(body).captures.first
556
597
  # some errors provide it directly
557
- @new_region = %r{<Region>([^<]*)</Region>}.match(body).captures.first
598
+ @new_region = %r{<Region>([^<]*)</Region>}.match(body) ? Regexp.last_match.captures.first : nil
558
599
  end
559
600
  Fog::Logger.warning("fog: followed redirect to #{host}, connecting to the matching region will be more performant")
560
601
  original_region, original_signer = @region, @signer
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AWS
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
@@ -9,20 +9,20 @@ Shindo.tests('AWS::Elasticache | cache clusters', ['aws', 'elasticache']) do
9
9
 
10
10
  pending if Fog.mocking?
11
11
 
12
- Formatador.display_line "Creating cluster #{cluster_params[:id]}..."
12
+ Fog::Formatador.display_line "Creating cluster #{cluster_params[:id]}..."
13
13
  model_tests(Fog::AWS[:elasticache].clusters, cluster_params, false) do
14
14
  @instance.reload # Reload to get the cluster info from AWS
15
- Formatador.display_line "Waiting for #{@instance.id} "+
15
+ Fog::Formatador.display_line "Waiting for #{@instance.id} "+
16
16
  "to become available (#{@instance.status})..."
17
17
  @instance.wait_for {ready?}
18
18
  end
19
19
 
20
20
  # Single model is still deleting, so re-randomize the cluster ID
21
21
  cluster_params[:id] = "fog-test-cluster-#{rand(999).to_s}"
22
- Formatador.display_line "Creating cluster #{cluster_params[:id]}..."
22
+ Fog::Formatador.display_line "Creating cluster #{cluster_params[:id]}..."
23
23
  collection_tests(Fog::AWS[:elasticache].clusters, cluster_params, false) do
24
24
  @instance.reload # Reload to get the cluster info from AWS
25
- Formatador.display_line "Waiting for #{@instance.id} "+
25
+ Fog::Formatador.display_line "Waiting for #{@instance.id} "+
26
26
  "to become available (#{@instance.status})..."
27
27
  @instance.wait_for {ready?}
28
28
  end
@@ -69,7 +69,7 @@ Shindo.tests('AWS::ELB | models', ['aws', 'elb']) do
69
69
  Fog::Compute[:aws].disable_ec2_classic if Fog.mocking?
70
70
 
71
71
  if Fog::Compute[:aws].supported_platforms.include?("EC2")
72
- Formatador.display_line("[yellow]Skipping test [bold]with default vpc[/][yellow] due to AWS account having EC2 available[/]")
72
+ Fog::Formatador.display_line("[yellow]Skipping test [bold]with default vpc[/][yellow] due to AWS account having EC2 available[/]")
73
73
  else
74
74
  elb2 = Fog::AWS[:elb].load_balancers.create(:id => "#{elb_id}-2", :availability_zones => @availability_zones[0])
75
75
  tests("elb source group should start with default_elb_").returns(true) { !!(elb2.source_group["GroupName"] =~ /default_elb_/) }
@@ -1,8 +1,8 @@
1
1
  Shindo.tests("AWS::RDS | tagging", ['aws', 'rds']) do
2
2
 
3
3
  @server = Fog::AWS[:rds].servers.create(rds_default_server_params)
4
- Formatador.display_line "Creating RDS instance #{@server.id}"
5
- Formatador.display_line "Waiting for instance #{@server.id} to be ready"
4
+ Fog::Formatador.display_line "Creating RDS instance #{@server.id}"
5
+ Fog::Formatador.display_line "Waiting for instance #{@server.id} to be ready"
6
6
  @server.wait_for { ready? }
7
7
 
8
8
  tags1 = {'key1' => 'val1'}
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
-
3
2
  Shindo.tests('AWS | url', ["aws"]) do
4
3
 
5
4
 
@@ -14,11 +13,30 @@ Shindo.tests('AWS | url', ["aws"]) do
14
13
 
15
14
  now = Fog::Time.now
16
15
  if RUBY_VERSION > '1.8.7' # ruby 1.8.x doesn't provide hash ordering
17
- tests('#url w/ response-cache-control').returns(
16
+ tests('#v4 url w/ response-cache-control').returns(
18
17
  "https://fognonbucket.s3.amazonaws.com/test.txt?response-cache-control=No-cache&X-Amz-Expires=500&X-Amz-Date=#{now.to_iso8601_basic}&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=123/#{now.utc.strftime('%Y%m%d')}/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature="
19
18
  ) do
20
19
 
21
- @file.url(Time.now + 500, :query => { 'response-cache-control' => 'No-cache' }).gsub(/(X-Amz-Signature=)[0-9a-f]+\z/,'\\1')
20
+ @file.url(now + 500, :query => { 'response-cache-control' => 'No-cache' }).gsub(/(X-Amz-Signature=)[0-9a-f]+\z/,'\\1')
21
+ end
22
+ end
23
+
24
+ @storage = Fog::Storage.new(
25
+ :provider => 'AWS',
26
+ :aws_access_key_id => '123',
27
+ :aws_secret_access_key => 'abc',
28
+ :aws_signature_version => 2,
29
+ :region => 'us-east-1'
30
+ )
31
+
32
+ @file = @storage.directories.new(:key => 'fognonbucket').files.new(:key => 'test.txt')
33
+
34
+ if RUBY_VERSION > '1.8.7' # ruby 1.8.x doesn't provide hash ordering
35
+ tests('#v2 url w/ response-cache-control').returns(
36
+ "https://fognonbucket.s3.amazonaws.com/test.txt?response-cache-control=No-cache&AWSAccessKeyId=123&Signature=foo&Expires=#{now.to_i + 500}"
37
+ ) do
38
+
39
+ @file.url(now + 500, :query => { 'response-cache-control' => 'No-cache' })
22
40
  end
23
41
  end
24
42
 
@@ -46,7 +46,7 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
46
46
  body
47
47
  end
48
48
 
49
- Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
49
+ Fog::Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
50
50
  Fog::AWS[:elasticache].clusters.get(CLUSTER_ID).wait_for {ready?}
51
51
 
52
52
  tests(
@@ -77,7 +77,7 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
77
77
  ).formats(AWS::Elasticache::Formats::CACHE_CLUSTER_RUNNING) do
78
78
  c = Fog::AWS[:elasticache].clusters.get(CLUSTER_ID)
79
79
  node_id = c.nodes.last['CacheNodeId']
80
- Formatador.display_line "Rebooting node #{node_id}..."
80
+ Fog::Formatador.display_line "Rebooting node #{node_id}..."
81
81
  body = Fog::AWS[:elasticache].reboot_cache_cluster(c.id, [ node_id ]).body
82
82
  returns('rebooting cache cluster nodes') do
83
83
  body['CacheCluster']['CacheClusterStatus']
@@ -85,7 +85,7 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
85
85
  body['CacheCluster']
86
86
  end
87
87
 
88
- Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
88
+ Fog::Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
89
89
  Fog::AWS[:elasticache].clusters.get(CLUSTER_ID).wait_for {ready?}
90
90
 
91
91
  tests(
@@ -93,7 +93,7 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
93
93
  ).formats(AWS::Elasticache::Formats::CACHE_CLUSTER_RUNNING) do
94
94
  c = Fog::AWS[:elasticache].clusters.get(CLUSTER_ID)
95
95
  node_id = c.nodes.last['CacheNodeId']
96
- Formatador.display_line "Removing node #{node_id}..."
96
+ Fog::Formatador.display_line "Removing node #{node_id}..."
97
97
  body = Fog::AWS[:elasticache].modify_cache_cluster(c.id,
98
98
  {
99
99
  :num_nodes => NUM_NODES - 1,
@@ -106,7 +106,7 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
106
106
  body['CacheCluster']
107
107
  end
108
108
 
109
- Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
109
+ Fog::Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
110
110
  Fog::AWS[:elasticache].clusters.get(CLUSTER_ID).wait_for {ready?}
111
111
 
112
112
  tests(
@@ -1,11 +1,11 @@
1
1
  Shindo.tests('AWS::RDS | tagging requests', ['aws', 'rds']) do
2
2
  @rds = Fog::AWS[:rds]
3
3
  @db_instance_id = "fog-test-#{rand(65536).to_s(16)}"
4
- Formatador.display_line "Creating RDS instance #{@db_instance_id}"
4
+ Fog::Formatador.display_line "Creating RDS instance #{@db_instance_id}"
5
5
  @rds.create_db_instance(@db_instance_id, 'AllocatedStorage' => 5,
6
6
  'DBInstanceClass' => 'db.t1.micro', 'Engine' => 'mysql',
7
7
  'MasterUsername' => 'foguser', 'MasterUserPassword' => 'fogpassword')
8
- Formatador.display_line "Waiting for instance #{@db_instance_id} to be ready"
8
+ Fog::Formatador.display_line "Waiting for instance #{@db_instance_id} to be ready"
9
9
  @db = @rds.servers.get(@db_instance_id)
10
10
  @db.wait_for { ready? }
11
11
 
@@ -73,6 +73,6 @@ Shindo.tests('AWS::RDS | tagging requests', ['aws', 'rds']) do
73
73
  end
74
74
  end
75
75
 
76
- Formatador.display_line "Destroying DB instance #{@db_instance_id}"
76
+ Fog::Formatador.display_line "Destroying DB instance #{@db_instance_id}"
77
77
  @db.destroy
78
78
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-23 00:00:00.000000000 Z
12
+ date: 2015-01-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler