fog 0.0.70 → 0.0.71
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml
CHANGED
data/fog.gemspec
CHANGED
@@ -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']
|
79
|
-
instance['
|
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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
@data[:
|
48
|
-
|
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' =>
|
64
|
+
'instanceId' => id,
|
65
65
|
'previousState' => instance['instanceState'],
|
66
66
|
'currentState' => state
|
67
67
|
}
|
68
68
|
instance['instanceState'] = state
|
69
|
+
end
|
69
70
|
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|
-
|
77
|
-
|
78
|
-
|
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
|