fog 0.0.69 → 0.0.70

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 69
4
+ :patch: 70
5
5
  :build:
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fog}
8
- s.version = "0.0.69"
8
+ s.version = "0.0.70"
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)"]
12
- s.date = %q{2010-04-08}
12
+ s.date = %q{2010-04-09}
13
13
  s.default_executable = %q{fog}
14
14
  s.description = %q{The Ruby cloud computing library.}
15
15
  s.email = %q{geemus@gmail.com}
@@ -77,6 +77,7 @@ module Fog
77
77
  :addresses => {},
78
78
  :instances => {},
79
79
  :key_pairs => {},
80
+ :limits => { :addresses => 5 },
80
81
  :security_groups => {
81
82
  'default' => {
82
83
  'groupDescription' => 'default group',
@@ -25,18 +25,24 @@ module Fog
25
25
 
26
26
  def allocate_address
27
27
  response = Excon::Response.new
28
- response.status = 200
29
- public_ip = Fog::AWS::Mock.ip_address
30
- data ={
31
- 'instanceId' => '',
32
- 'publicIp' => public_ip
33
- }
34
- @data[:addresses][public_ip] = data
35
- response.body = {
36
- 'publicIp' => public_ip,
37
- 'requestId' => Fog::AWS::Mock.request_id
38
- }
39
- response
28
+ if describe_addresses.body['addressesSet'].size < @data[:limits][:addresses]
29
+ response.status = 200
30
+ public_ip = Fog::AWS::Mock.ip_address
31
+ data ={
32
+ 'instanceId' => '',
33
+ 'publicIp' => public_ip
34
+ }
35
+ @data[:addresses][public_ip] = data
36
+ response.body = {
37
+ 'publicIp' => public_ip,
38
+ 'requestId' => Fog::AWS::Mock.request_id
39
+ }
40
+ response
41
+ else
42
+ response.status = 400
43
+ response.body = "<?xml version=\"1.0\"?><Response><Errors><Error><Code>AddressLimitExceeded</Code><Message>Too many addresses allocated</Message></Error></Errors><RequestID>#{Fog::AWS::Mock.request_id}</RequestID></Response>"
44
+ raise(Excon::Errors.status_error({:expects => 200}, response))
45
+ end
40
46
  end
41
47
 
42
48
  end
@@ -75,6 +75,7 @@ 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
78
79
  instance['instanceState'] = { 'code' => 16, 'name' => 'running' }
79
80
  end
80
81
  when 'rebooting'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 69
9
- version: 0.0.69
8
+ - 70
9
+ version: 0.0.70
10
10
  platform: ruby
11
11
  authors:
12
12
  - geemus (Wesley Beary)
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-08 00:00:00 -07:00
17
+ date: 2010-04-09 00:00:00 -07:00
18
18
  default_executable: fog
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency