fog 0.0.70 → 0.0.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 70
4
+ :patch: 71
5
5
  :build:
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fog}
8
- s.version = "0.0.70"
8
+ s.version = "0.0.71"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["geemus (Wesley Beary)"]
@@ -75,8 +75,10 @@ module Fog
75
75
  case instance['instanceState']['name']
76
76
  when 'pending'
77
77
  if Time.now - instance['launchTime'] > Fog::Mock::DELAY
78
- instance['dnsName'] = Fog::AWS::Mock.ip_address
79
- instance['instanceState'] = { 'code' => 16, 'name' => 'running' }
78
+ instance['dnsName'] = "ec2-#{Fog::AWS::Mock.ip_address.gsub('.','-')}.compute-1.amazonaws.com"
79
+ instance['privateIpAddress'] = Fog::AWS::Mock.ip_address
80
+ instance['privateDnsName'] = "ip-#{instance['privateDnsName'].gsub('.','-')}.ec2.internal"
81
+ instance['instanceState'] = { 'code' => 16, 'name' => 'running' }
80
82
  end
81
83
  when 'rebooting'
82
84
  instance['instanceState'] = { 'code' => 16, 'name' => 'running' }
@@ -122,6 +122,7 @@ module Fog
122
122
  'ownerId' => @owner_id,
123
123
  'placement' => { 'availabilityZone' => options['Placement.AvailabilityZone'] || Fog::AWS::Mock.availability_zone },
124
124
  'privateDnsName' => '',
125
+ 'privateIpAddress' => '',
125
126
  'productCodes' => [],
126
127
  'ramdiskId' => options['RamdiskId'] || Fog::AWS::Mock.ramdisk_id,
127
128
  'reason' => '',
@@ -38,14 +38,14 @@ module Fog
38
38
  response = Excon::Response.new
39
39
  instance_id = [*instance_id]
40
40
  if (@data[:instances].keys & instance_id).length == instance_id.length
41
- for instance_id in instance_id
42
- response.body = {
43
- 'requestId' => Fog::AWS::Mock.request_id,
44
- 'instancesSet' => []
45
- }
46
- instance = @data[:instances][instance_id]
47
- @data[:deleted_at][instance_id] = Time.now
48
- response.status = 200
41
+ response.body = {
42
+ 'requestId' => Fog::AWS::Mock.request_id,
43
+ 'instancesSet' => []
44
+ }
45
+ response.status = 200
46
+ for id in instance_id
47
+ instance = @data[:instances][id]
48
+ @data[:deleted_at][id] = Time.now
49
49
  # TODO: the codes are mostly educated guessing, not certainty
50
50
  code = case instance['state']
51
51
  when 'pending'
@@ -61,22 +61,22 @@ module Fog
61
61
  end
62
62
  state = { 'name' => 'shutting-down', 'code' => 32}
63
63
  response.body['instancesSet'] << {
64
- 'instanceId' => instance_id,
64
+ 'instanceId' => id,
65
65
  'previousState' => instance['instanceState'],
66
66
  'currentState' => state
67
67
  }
68
68
  instance['instanceState'] = state
69
+ end
69
70
 
70
- describe_addresses.body['addressesSet'].each do |address|
71
- if address['instanceId'] == instance_id
72
- disassociate_address(address['publicIp'])
73
- end
71
+ describe_addresses.body['addressesSet'].each do |address|
72
+ if instance_id.include?(address['instanceId'])
73
+ disassociate_address(address['publicIp'])
74
74
  end
75
+ end
75
76
 
76
- describe_volumes.body['volumeSet'].each do |volume|
77
- if volume['attachmentSet'].first && volume['attachmentSet'].first['instanceId'] == instance_id
78
- detach_volume(volume['volumeId'])
79
- end
77
+ describe_volumes.body['volumeSet'].each do |volume|
78
+ if volume['attachmentSet'].first && instance_id.include?(volume['attachmentSet'].first['instanceId'])
79
+ detach_volume(volume['volumeId'])
80
80
  end
81
81
  end
82
82
  else
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 70
9
- version: 0.0.70
8
+ - 71
9
+ version: 0.0.71
10
10
  platform: ruby
11
11
  authors:
12
12
  - geemus (Wesley Beary)