fog 0.0.31 → 0.0.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. data/.document +0 -2
  2. data/Rakefile +12 -7
  3. data/VERSION +1 -1
  4. data/bin/fog +16 -18
  5. data/fog.gemspec +34 -8
  6. data/lib/fog.rb +11 -0
  7. data/lib/fog/aws/models/ec2/address.rb +4 -0
  8. data/lib/fog/aws/models/ec2/instance.rb +17 -0
  9. data/lib/fog/aws/models/ec2/key_pair.rb +4 -0
  10. data/lib/fog/aws/models/ec2/security_group.rb +8 -0
  11. data/lib/fog/aws/models/ec2/snapshot.rb +7 -1
  12. data/lib/fog/aws/models/ec2/volume.rb +9 -1
  13. data/lib/fog/aws/models/s3/bucket.rb +10 -0
  14. data/lib/fog/aws/models/s3/buckets.rb +10 -4
  15. data/lib/fog/aws/models/s3/object.rb +5 -0
  16. data/lib/fog/aws/requests/ec2/allocate_address.rb +1 -1
  17. data/lib/fog/aws/requests/ec2/associate_address.rb +2 -2
  18. data/lib/fog/aws/requests/ec2/attach_volume.rb +2 -2
  19. data/lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb +1 -1
  20. data/lib/fog/aws/requests/ec2/create_key_pair.rb +2 -2
  21. data/lib/fog/aws/requests/ec2/create_security_group.rb +2 -2
  22. data/lib/fog/aws/requests/ec2/create_snapshot.rb +2 -2
  23. data/lib/fog/aws/requests/ec2/create_volume.rb +1 -1
  24. data/lib/fog/aws/requests/ec2/delete_key_pair.rb +1 -1
  25. data/lib/fog/aws/requests/ec2/delete_security_group.rb +2 -2
  26. data/lib/fog/aws/requests/ec2/delete_snapshot.rb +2 -2
  27. data/lib/fog/aws/requests/ec2/delete_volume.rb +2 -2
  28. data/lib/fog/aws/requests/ec2/describe_addresses.rb +2 -2
  29. data/lib/fog/aws/requests/ec2/describe_availability_zones.rb +1 -1
  30. data/lib/fog/aws/requests/ec2/describe_images.rb +1 -1
  31. data/lib/fog/aws/requests/ec2/describe_instances.rb +2 -2
  32. data/lib/fog/aws/requests/ec2/describe_key_pairs.rb +2 -2
  33. data/lib/fog/aws/requests/ec2/describe_regions.rb +1 -1
  34. data/lib/fog/aws/requests/ec2/describe_security_groups.rb +2 -2
  35. data/lib/fog/aws/requests/ec2/describe_snapshots.rb +2 -2
  36. data/lib/fog/aws/requests/ec2/describe_volumes.rb +2 -2
  37. data/lib/fog/aws/requests/ec2/detach_volume.rb +2 -2
  38. data/lib/fog/aws/requests/ec2/disassociate_address.rb +2 -2
  39. data/lib/fog/aws/requests/ec2/get_console_output.rb +2 -2
  40. data/lib/fog/aws/requests/ec2/reboot_instances.rb +2 -2
  41. data/lib/fog/aws/requests/ec2/release_address.rb +2 -2
  42. data/lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb +1 -1
  43. data/lib/fog/aws/requests/ec2/run_instances.rb +1 -1
  44. data/lib/fog/aws/requests/ec2/terminate_instances.rb +2 -2
  45. data/lib/fog/aws/requests/s3/copy_object.rb +2 -2
  46. data/lib/fog/aws/requests/s3/delete_bucket.rb +3 -3
  47. data/lib/fog/aws/requests/s3/delete_object.rb +8 -7
  48. data/lib/fog/aws/requests/s3/get_bucket.rb +2 -2
  49. data/lib/fog/aws/requests/s3/get_bucket_location.rb +2 -2
  50. data/lib/fog/aws/requests/s3/get_object.rb +2 -2
  51. data/lib/fog/aws/requests/s3/get_request_payment.rb +2 -2
  52. data/lib/fog/aws/requests/s3/get_service.rb +1 -1
  53. data/lib/fog/aws/requests/s3/put_bucket.rb +8 -6
  54. data/lib/fog/aws/requests/s3/put_object.rb +9 -9
  55. data/lib/fog/aws/requests/s3/put_request_payment.rb +2 -2
  56. data/lib/fog/aws/requests/simpledb/batch_put_attributes.rb +2 -2
  57. data/lib/fog/aws/requests/simpledb/create_domain.rb +1 -1
  58. data/lib/fog/aws/requests/simpledb/delete_attributes.rb +2 -2
  59. data/lib/fog/aws/requests/simpledb/delete_domain.rb +1 -1
  60. data/lib/fog/aws/requests/simpledb/domain_metadata.rb +2 -2
  61. data/lib/fog/aws/requests/simpledb/get_attributes.rb +2 -2
  62. data/lib/fog/aws/requests/simpledb/list_domains.rb +1 -1
  63. data/lib/fog/aws/s3.rb +1 -12
  64. data/lib/fog/collection.rb +16 -8
  65. data/lib/fog/model.rb +36 -14
  66. data/lib/fog/rackspace/models/servers/image.rb +40 -0
  67. data/lib/fog/rackspace/models/servers/images.rb +50 -0
  68. data/lib/fog/rackspace/models/servers/server.rb +18 -2
  69. data/lib/fog/rackspace/requests/servers/create_image.rb +18 -1
  70. data/lib/fog/rackspace/requests/servers/create_server.rb +5 -5
  71. data/lib/fog/rackspace/requests/servers/delete_image.rb +16 -1
  72. data/lib/fog/rackspace/requests/servers/delete_server.rb +4 -4
  73. data/lib/fog/rackspace/requests/servers/get_server_details.rb +2 -2
  74. data/lib/fog/rackspace/requests/servers/list_addresses.rb +2 -2
  75. data/lib/fog/rackspace/requests/servers/list_images.rb +10 -0
  76. data/lib/fog/rackspace/requests/servers/list_images_detail.rb +16 -1
  77. data/lib/fog/rackspace/requests/servers/list_private_addresses.rb +2 -2
  78. data/lib/fog/rackspace/requests/servers/list_public_addresses.rb +2 -2
  79. data/lib/fog/rackspace/requests/servers/list_servers.rb +1 -1
  80. data/lib/fog/rackspace/requests/servers/list_servers_detail.rb +2 -2
  81. data/lib/fog/rackspace/requests/servers/update_server.rb +2 -2
  82. data/lib/fog/rackspace/servers.rb +8 -2
  83. data/lib/fog/slicehost.rb +66 -0
  84. data/lib/fog/slicehost/parsers/create_slice.rb +29 -0
  85. data/lib/fog/slicehost/parsers/get_backups.rb +30 -0
  86. data/lib/fog/slicehost/parsers/get_flavors.rb +28 -0
  87. data/lib/fog/slicehost/parsers/get_images.rb +28 -0
  88. data/lib/fog/slicehost/parsers/get_slices.rb +33 -0
  89. data/lib/fog/slicehost/requests/create_slice.rb +50 -0
  90. data/lib/fog/slicehost/requests/delete_slice.rb +48 -0
  91. data/lib/fog/slicehost/requests/get_backups.rb +38 -0
  92. data/lib/fog/slicehost/requests/get_flavors.rb +38 -0
  93. data/lib/fog/slicehost/requests/get_images.rb +36 -0
  94. data/lib/fog/slicehost/requests/get_slices.rb +44 -0
  95. data/spec/aws/requests/s3/put_object_spec.rb +8 -0
  96. data/spec/rackspace/requests/servers/create_image_spec.rb +1 -1
  97. data/spec/rackspace/requests/servers/create_server_spec.rb +1 -1
  98. data/spec/rackspace/requests/servers/delete_image_spec.rb +7 -5
  99. data/spec/rackspace/requests/servers/delete_server_spec.rb +1 -1
  100. data/spec/rackspace/requests/servers/get_server_details_spec.rb +1 -1
  101. data/spec/rackspace/requests/servers/list_addresses_spec.rb +1 -1
  102. data/spec/rackspace/requests/servers/list_private_addresses_spec.rb +1 -1
  103. data/spec/rackspace/requests/servers/list_public_addresses_spec.rb +1 -1
  104. data/spec/rackspace/requests/servers/list_servers_detail_spec.rb +1 -1
  105. data/spec/rackspace/requests/servers/list_servers_spec.rb +1 -1
  106. data/spec/rackspace/requests/servers/reboot_server_spec.rb +1 -1
  107. data/spec/rackspace/requests/servers/update_server_spec.rb +1 -1
  108. data/spec/slicehost/requests/create_slice_spec.rb +29 -0
  109. data/spec/slicehost/requests/delete_slice_spec.rb +18 -0
  110. data/spec/slicehost/requests/get_backups_spec.rb +17 -0
  111. data/spec/slicehost/requests/get_flavors_spec.rb +17 -0
  112. data/spec/slicehost/requests/get_images_spec.rb +15 -0
  113. data/spec/slicehost/requests/get_slices_spec.rb +23 -0
  114. data/spec/spec_helper.rb +20 -22
  115. metadata +29 -4
  116. data/lib/fog/aws/models/s3/owner.rb +0 -18
@@ -12,13 +12,16 @@ module Fog
12
12
 
13
13
  def all
14
14
  data = connection.get_service.body
15
- owner = Fog::AWS::S3::Owner.new(data.delete('Owner').merge!(:connection => connection))
15
+ owner = Fog::AWS::S3::Owner.new(data.delete('Owner'))
16
16
  buckets = Fog::AWS::S3::Buckets.new(:connection => connection)
17
17
  data['Buckets'].each do |bucket|
18
18
  buckets << Fog::AWS::S3::Bucket.new({
19
19
  :collection => buckets,
20
20
  :connection => connection,
21
- :owner => owner
21
+ :owner => {
22
+ :display_name => owner['DisplayName'],
23
+ :id => owner['ID']
24
+ }
22
25
  }.merge!(bucket))
23
26
  end
24
27
  buckets
@@ -42,12 +45,15 @@ module Fog
42
45
  end
43
46
  bucket.objects.merge_attributes(options)
44
47
  data['Contents'].each do |object|
45
- owner = Fog::AWS::S3::Owner.new(object.delete('Owner').merge!(:connection => connection))
48
+ owner = Fog::AWS::S3::Owner.new(object.delete('Owner'))
46
49
  bucket.objects << Fog::AWS::S3::Object.new({
47
50
  :bucket => bucket,
48
51
  :connection => connection,
49
52
  :collection => bucket.objects,
50
- :owner => owner
53
+ :owner => {
54
+ :display_name => owner['DisplayName'],
55
+ :id => owner['ID']
56
+ }
51
57
  }.merge!(object))
52
58
  end
53
59
  bucket
@@ -20,6 +20,8 @@ module Fog
20
20
  end
21
21
 
22
22
  def copy(target_bucket_name, target_object_key)
23
+ requires :bucket, :key
24
+
23
25
  data = connection.copy_object(bucket.name, @key, target_bucket_name, target_object_key).body
24
26
  target_bucket = connection.buckets.new(:name => target_bucket_name)
25
27
  target_object = target_bucket.objects.new(attributes.merge!(:key => target_object_key))
@@ -34,11 +36,14 @@ module Fog
34
36
  end
35
37
 
36
38
  def destroy
39
+ requires :bucket, :key
40
+
37
41
  connection.delete_object(bucket.name, @key)
38
42
  true
39
43
  end
40
44
 
41
45
  def save(options = {})
46
+ requires :body, :bucket, :key
42
47
  data = connection.put_object(bucket.name, @key, @body, options)
43
48
  @etag = data.headers['ETag']
44
49
  true
@@ -28,7 +28,7 @@ else
28
28
  class EC2
29
29
 
30
30
  def allocate_address
31
- response = Fog::Response.new
31
+ response = Excon::Response.new
32
32
  response.status = 200
33
33
  public_ip = Fog::AWS::Mock.ip_address
34
34
  data ={
@@ -34,7 +34,7 @@ else
34
34
  class EC2
35
35
 
36
36
  def associate_address(instance_id, public_ip)
37
- response = Fog::Response.new
37
+ response = Excon::Response.new
38
38
  response.status = 200
39
39
  instance = Fog::AWS::EC2.data[:instances][instance_id]
40
40
  address = Fog::AWS::EC2.data[:addresses][public_ip]
@@ -47,7 +47,7 @@ else
47
47
  }
48
48
  else
49
49
  response.status = 400
50
- raise(Excon::Errors.status_error(200, 400, response))
50
+ raise(Excon::Errors.status_error({:expects => 200}, response))
51
51
  end
52
52
  response
53
53
  end
@@ -40,7 +40,7 @@ else
40
40
  class EC2
41
41
 
42
42
  def attach_volume(instance_id, volume_id, device)
43
- response = Fog::Response.new
43
+ response = Excon::Response.new
44
44
  if instance_id && volume_id && device
45
45
  response.status = 200
46
46
  instance = Fog::AWS::EC2.data[:instances][instance_id]
@@ -60,7 +60,7 @@ else
60
60
  }.merge!(data)
61
61
  else
62
62
  response.status = 400
63
- raise(Excon::Errors.status_error(200, 400, response))
63
+ raise(Excon::Errors.status_error({:expects => 200}, response))
64
64
  end
65
65
  else
66
66
  response.status = 400
@@ -41,7 +41,7 @@ else
41
41
 
42
42
  # TODO: handle the GroupName/Source/Source case
43
43
  def authorize_security_group_ingress(options = {})
44
- response = Fog::Response.new
44
+ response = Excon::Response.new
45
45
  group = Fog::AWS::EC2.data[:security_groups][options['GroupName']]
46
46
 
47
47
  group['ipPermissions'] ||= []
@@ -34,7 +34,7 @@ else
34
34
  class EC2
35
35
 
36
36
  def create_key_pair(key_name)
37
- response = Fog::Response.new
37
+ response = Excon::Response.new
38
38
  unless Fog::AWS::EC2.data[:key_pairs][key_name]
39
39
  response.status = 200
40
40
  data = {
@@ -48,7 +48,7 @@ else
48
48
  }.merge!(data)
49
49
  else
50
50
  response.status = 400
51
- raise(Excon::Errors.status_error(200, 400, response))
51
+ raise(Excon::Errors.status_error({:expects => 200}, response))
52
52
  end
53
53
  response
54
54
  end
@@ -34,7 +34,7 @@ else
34
34
  class EC2
35
35
 
36
36
  def create_security_group(name, description)
37
- response = Fog::Response.new
37
+ response = Excon::Response.new
38
38
  unless Fog::AWS::EC2.data[:security_groups][name]
39
39
  data = {
40
40
  'groupDescription' => description,
@@ -49,7 +49,7 @@ else
49
49
  }
50
50
  else
51
51
  response.status = 400
52
- raise(Excon::Errors.status_error(200, 400, response))
52
+ raise(Excon::Errors.status_error({:expects => 200}, response))
53
53
  end
54
54
  response
55
55
  end
@@ -36,7 +36,7 @@ else
36
36
  class EC2
37
37
 
38
38
  def create_snapshot(volume_id)
39
- response = Fog::Response.new
39
+ response = Excon::Response.new
40
40
  if Fog::AWS::EC2.data[:volumes][volume_id]
41
41
  response.status = 200
42
42
  snapshot_id = Fog::AWS::Mock.snapshot_id
@@ -53,7 +53,7 @@ else
53
53
  }.merge!(data)
54
54
  else
55
55
  response.status = 400
56
- raise(Excon::Errors.status_error(200, 400, response))
56
+ raise(Excon::Errors.status_error({:expects => 200}, response))
57
57
  end
58
58
  response
59
59
  end
@@ -40,7 +40,7 @@ else
40
40
  class EC2
41
41
 
42
42
  def create_volume(availability_zone, size, snapshot_id = nil)
43
- response = Fog::Response.new
43
+ response = Excon::Response.new
44
44
  if availability_zone && size
45
45
  response.status = 200
46
46
  volume_id = Fog::AWS::Mock.volume_id
@@ -32,7 +32,7 @@ else
32
32
  class EC2
33
33
 
34
34
  def delete_key_pair(key_name)
35
- response = Fog::Response.new
35
+ response = Excon::Response.new
36
36
  Fog::AWS::EC2.data[:key_pairs].delete(key_name)
37
37
  response.status = 200
38
38
  response.body = {
@@ -31,7 +31,7 @@ else
31
31
  module AWS
32
32
  class EC2
33
33
  def delete_security_group(name)
34
- response = Fog::Response.new
34
+ response = Excon::Response.new
35
35
  if Fog::AWS::EC2.data[:security_groups][name]
36
36
  Fog::AWS::EC2.data[:security_groups].delete(name)
37
37
  response.status = 200
@@ -41,7 +41,7 @@ else
41
41
  }
42
42
  else
43
43
  response.status = 400
44
- raise(Excon::Errors.status_error(200, 400, response))
44
+ raise(Excon::Errors.status_error({:expects => 200}, response))
45
45
  end
46
46
  response
47
47
  end
@@ -32,7 +32,7 @@ else
32
32
  class EC2
33
33
 
34
34
  def delete_snapshot(snapshot_id)
35
- response = Fog::Response.new
35
+ response = Excon::Response.new
36
36
  if snapshot = Fog::AWS::EC2.data[:snapshots].delete(snapshot_id)
37
37
  response.status = true
38
38
  response.body = {
@@ -41,7 +41,7 @@ else
41
41
  }
42
42
  else
43
43
  response.status = 400
44
- raise(Excon::Errors.status_error(200, 400, response))
44
+ raise(Excon::Errors.status_error({:expects => 200}, response))
45
45
  end
46
46
  response
47
47
  end
@@ -32,7 +32,7 @@ else
32
32
  class EC2
33
33
 
34
34
  def delete_volume(volume_id)
35
- response = Fog::Response.new
35
+ response = Excon::Response.new
36
36
  if volume = Fog::AWS::EC2.data[:volumes][volume_id]
37
37
  Fog::AWS::EC2.data[:deleted_at][volume_id] = Time.now
38
38
  volume['status'] = 'deleting'
@@ -43,7 +43,7 @@ else
43
43
  }
44
44
  else
45
45
  response.status = 400
46
- raise(Excon::Errors.status_error(200, 400, response))
46
+ raise(Excon::Errors.status_error({:expects => 200}, response))
47
47
  end
48
48
  response
49
49
  end
@@ -34,7 +34,7 @@ else
34
34
  class EC2
35
35
 
36
36
  def describe_addresses(public_ip = [])
37
- response = Fog::Response.new
37
+ response = Excon::Response.new
38
38
  public_ip = [*public_ip]
39
39
  if public_ip != []
40
40
  addresses_set = Fog::AWS::EC2.data[:addresses].reject {|key, value| !public_ip.include?(key)}.values
@@ -49,7 +49,7 @@ else
49
49
  }
50
50
  else
51
51
  response.status = 400
52
- raise(Excon::Errors.status_error(200, 400, response))
52
+ raise(Excon::Errors.status_error({:expects => 200}, response))
53
53
  end
54
54
  response
55
55
  end
@@ -35,7 +35,7 @@ else
35
35
  class EC2
36
36
 
37
37
  def describe_availability_zones(zone_name = [])
38
- response = Fog::Response.new
38
+ response = Excon::Response.new
39
39
  zone_name = [*zone_name]
40
40
  zones = {
41
41
  'us-east-1a' => {"zoneName"=>"us-east-1a", "regionName"=>"us-east-1", "zoneState"=>"available"},
@@ -49,7 +49,7 @@ else
49
49
  class EC2
50
50
 
51
51
  def describe_images(options = {})
52
- response = Fog::Response.new
52
+ response = Excon::Response.new
53
53
  images = []
54
54
 
55
55
  (rand(101 + 100)).times do
@@ -56,7 +56,7 @@ else
56
56
  class EC2
57
57
 
58
58
  def describe_instances(instance_id = {})
59
- response = Fog::Response.new
59
+ response = Excon::Response.new
60
60
  instance_id = [*instance_id]
61
61
  if instance_id != []
62
62
  instance_set = Fog::AWS::EC2.data[:instances].reject {|key,value| !instance_id.include?(key)}.values
@@ -104,7 +104,7 @@ else
104
104
  }
105
105
  else
106
106
  response.status = 400
107
- raise(Excon::Errors.status_error(200, 400, response))
107
+ raise(Excon::Errors.status_error({:expects => 200}, response))
108
108
  end
109
109
  response
110
110
  end
@@ -34,7 +34,7 @@ else
34
34
  class EC2
35
35
 
36
36
  def describe_key_pairs(key_name = [])
37
- response = Fog::Response.new
37
+ response = Excon::Response.new
38
38
  key_name = [*key_name]
39
39
  if key_name != []
40
40
  key_set = Fog::AWS::EC2.data[:key_pairs].reject {|key, value| !key_name.include?(key)}.values
@@ -51,7 +51,7 @@ else
51
51
  }
52
52
  else
53
53
  response.status = 400
54
- raise(Excon::Errors.status_error(200, 400, response))
54
+ raise(Excon::Errors.status_error({:expects => 200}, response))
55
55
  end
56
56
  response
57
57
  end
@@ -34,7 +34,7 @@ else
34
34
  class EC2
35
35
 
36
36
  def describe_regions(region_name = [])
37
- response = Fog::Response.new
37
+ response = Excon::Response.new
38
38
  region_name = [*region_name]
39
39
  regions = {
40
40
  'eu-west-1' => {"regionName"=>"eu-west-1", "regionEndpoint"=>"eu-west-1.ec2.amazonaws.com"},
@@ -44,7 +44,7 @@ else
44
44
  class EC2
45
45
 
46
46
  def describe_security_groups(group_name = [])
47
- response = Fog::Response.new
47
+ response = Excon::Response.new
48
48
  group_name = [*group_name]
49
49
  if group_name != []
50
50
  security_group_info = Fog::AWS::EC2.data[:security_groups].reject {|key, value| !group_name.include?(key)}.values
@@ -59,7 +59,7 @@ else
59
59
  }
60
60
  else
61
61
  response.status = 400
62
- raise(Excon::Errors.status_error(200, 400, response))
62
+ raise(Excon::Errors.status_error({:expects => 200}, response))
63
63
  end
64
64
  response
65
65
  end
@@ -37,7 +37,7 @@ else
37
37
  class EC2
38
38
 
39
39
  def describe_snapshots(snapshot_id = [])
40
- response = Fog::Response.new
40
+ response = Excon::Response.new
41
41
  snapshot_id = [*snapshot_id]
42
42
  if snapshot_id != []
43
43
  snapshot_set = Fog::AWS::EC2.data[:snapshots].reject {|key,value| !snapshot_id.include?(key)}.values
@@ -66,7 +66,7 @@ else
66
66
  }
67
67
  else
68
68
  response.status = 400
69
- raise(Excon::Errors.status_error(200, 400, response))
69
+ raise(Excon::Errors.status_error({:expects => 200}, response))
70
70
  end
71
71
  response
72
72
  end
@@ -43,7 +43,7 @@ else
43
43
  class EC2
44
44
 
45
45
  def describe_volumes(volume_id = [])
46
- response = Fog::Response.new
46
+ response = Excon::Response.new
47
47
  volume_id = [*volume_id]
48
48
  if volume_id != []
49
49
  volume_set = Fog::AWS::EC2.data[:volumes].reject {|key,value| !volume_id.include?(key)}.values
@@ -73,7 +73,7 @@ else
73
73
  }
74
74
  else
75
75
  response.status = 400
76
- raise(Excon::Errors.status_error(200, 400, response))
76
+ raise(Excon::Errors.status_error({:expects => 200}, response))
77
77
  end
78
78
  response
79
79
  end
@@ -40,7 +40,7 @@ else
40
40
  class EC2
41
41
 
42
42
  def detach_volume(volume_id, options = {})
43
- response = Fog::Response.new
43
+ response = Excon::Response.new
44
44
  response.status = 200
45
45
  if volume = Fog::AWS::EC2.data[:volumes][volume_id]
46
46
  data = volume['attachmentSet'].pop
@@ -50,7 +50,7 @@ else
50
50
  }.merge!(data)
51
51
  else
52
52
  response.status = 400
53
- raise(Excon::Errors.status_error(200, 400, response))
53
+ raise(Excon::Errors.status_error({:expects => 200}, response))
54
54
  end
55
55
  response
56
56
  end
@@ -32,7 +32,7 @@ else
32
32
  class EC2
33
33
 
34
34
  def disassociate_address(public_ip)
35
- response = Fog::Response.new
35
+ response = Excon::Response.new
36
36
  response.status = 200
37
37
  if address = Fog::AWS::EC2.data[:addresses][public_ip]
38
38
  address['instanceId'] = ''
@@ -43,7 +43,7 @@ else
43
43
  }
44
44
  else
45
45
  response.status = 400
46
- raise(Excon::Errors.status_error(200, 400, response))
46
+ raise(Excon::Errors.status_error({:expects => 200}, response))
47
47
  end
48
48
  response
49
49
  end
@@ -34,7 +34,7 @@ else
34
34
  class EC2
35
35
 
36
36
  def get_console_output(instance_id)
37
- response = Fog::Response.new
37
+ response = Excon::Response.new
38
38
  if instance = Fog::AWS::EC2.data[:instances][instance_id]
39
39
  response.status = 200
40
40
  response.body = {
@@ -45,7 +45,7 @@ else
45
45
  }
46
46
  else
47
47
  response.status = 400
48
- raise(Excon::Errors.status_error(200, 400, response))
48
+ raise(Excon::Errors.status_error({:expects => 200}, response))
49
49
  end
50
50
  response
51
51
  end