fog 0.0.89 → 0.0.90

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/benchs/parse_vs_push.rb +1 -1
  2. data/fog.gemspec +2 -2
  3. data/lib/fog.rb +1 -1
  4. data/lib/fog/aws/parsers/ec2/describe_images.rb +1 -1
  5. data/lib/fog/aws/parsers/ec2/describe_instances.rb +1 -1
  6. data/lib/fog/aws/parsers/ec2/describe_security_groups.rb +1 -1
  7. data/lib/fog/aws/parsers/ec2/describe_volumes.rb +1 -1
  8. data/lib/fog/aws/parsers/ec2/get_console_output.rb +3 -1
  9. data/lib/fog/aws/parsers/ec2/run_instances.rb +1 -1
  10. data/lib/fog/aws/parsers/ec2/terminate_instances.rb +1 -1
  11. data/lib/fog/aws/parsers/elb/describe_load_balancers.rb +1 -1
  12. data/lib/fog/parser.rb +2 -1
  13. data/lib/fog/terremark/parsers/shared/get_catalog.rb +1 -1
  14. data/lib/fog/terremark/parsers/shared/get_catalog_item.rb +1 -1
  15. data/lib/fog/terremark/parsers/shared/get_internet_services.rb +1 -1
  16. data/lib/fog/terremark/parsers/shared/get_network_ips.rb +0 -4
  17. data/lib/fog/terremark/parsers/shared/get_organization.rb +1 -1
  18. data/lib/fog/terremark/parsers/shared/get_organizations.rb +1 -1
  19. data/lib/fog/terremark/parsers/shared/get_tasks_list.rb +1 -1
  20. data/lib/fog/terremark/parsers/shared/get_vapp_template.rb +1 -1
  21. data/lib/fog/terremark/parsers/shared/get_vdc.rb +1 -1
  22. data/lib/fog/terremark/parsers/shared/instantiate_vapp_template.rb +1 -1
  23. data/lib/fog/terremark/parsers/shared/internet_service.rb +1 -1
  24. data/lib/fog/terremark/parsers/shared/network.rb +1 -1
  25. data/lib/fog/terremark/parsers/shared/task.rb +1 -1
  26. data/lib/fog/terremark/parsers/shared/vapp.rb +1 -1
  27. data/spec/aws/requests/ec2/create_snapshot_spec.rb +1 -1
  28. data/spec/aws/requests/ec2/create_volume_spec.rb +1 -1
  29. data/spec/aws/requests/ec2/describe_instances_spec.rb +7 -2
  30. data/spec/aws/requests/ec2/describe_volumes_spec.rb +2 -2
  31. data/spec/aws/requests/ec2/get_console_output_spec.rb +7 -5
  32. data/spec/aws/requests/ec2/run_instances_spec.rb +3 -3
  33. metadata +3 -3
@@ -20,7 +20,7 @@ class Parser < Nokogiri::XML::SAX::Document
20
20
  end
21
21
 
22
22
  def start_element(name, attrs = [])
23
- @value = ''
23
+ @value = nil
24
24
  end
25
25
 
26
26
  def end_element(name)
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
7
7
  ## If your rubyforge_project name is different, then edit it and comment out
8
8
  ## the sub! line in the Rakefile
9
9
  s.name = 'fog'
10
- s.version = '0.0.89'
11
- s.date = '2010-05-04'
10
+ s.version = '0.0.90'
11
+ s.date = '2010-05-05'
12
12
  s.rubyforge_project = 'fog'
13
13
 
14
14
  ## Make sure your summary is short. The description may be as long
data/lib/fog.rb CHANGED
@@ -34,7 +34,7 @@ require 'fog/terremark'
34
34
  module Fog
35
35
 
36
36
  unless const_defined?(:VERSION)
37
- VERSION = '0.0.89'
37
+ VERSION = '0.0.90'
38
38
  end
39
39
 
40
40
  module Mock
@@ -11,10 +11,10 @@ module Fog
11
11
  end
12
12
 
13
13
  def start_element(name, attrs = [])
14
+ super
14
15
  if name == 'productCodes'
15
16
  @in_product_codes = true
16
17
  end
17
- @value = ''
18
18
  end
19
19
 
20
20
  def end_element(name)
@@ -13,6 +13,7 @@ module Fog
13
13
  end
14
14
 
15
15
  def start_element(name, attrs = [])
16
+ super
16
17
  case name
17
18
  when 'blockDeviceMapping'
18
19
  @in_block_device_mapping = true
@@ -21,7 +22,6 @@ module Fog
21
22
  when 'instancesSet'
22
23
  @in_instances_set = true
23
24
  end
24
- @value = ''
25
25
  end
26
26
 
27
27
  def end_element(name)
@@ -14,6 +14,7 @@ module Fog
14
14
  end
15
15
 
16
16
  def start_element(name, attrs = [])
17
+ super
17
18
  if name == 'groups'
18
19
  @in_groups = true
19
20
  elsif name == 'ipPermissions'
@@ -21,7 +22,6 @@ module Fog
21
22
  elsif name == 'ipRanges'
22
23
  @in_ip_ranges = true
23
24
  end
24
- @value = ''
25
25
  end
26
26
 
27
27
  def end_element(name)
@@ -13,10 +13,10 @@ module Fog
13
13
  end
14
14
 
15
15
  def start_element(name, attrs = [])
16
+ super
16
17
  if name == 'attachmentSet'
17
18
  @in_attachment_set = true
18
19
  end
19
- @value = ''
20
20
  end
21
21
 
22
22
  def end_element(name)
@@ -14,7 +14,9 @@ module Fog
14
14
  when 'instanceId', 'requestId'
15
15
  @response[name] = @value
16
16
  when 'output'
17
- @response[name] = Base64.decode64(@value)
17
+ if @value
18
+ @response[name] = Base64.decode64(@value)
19
+ end
18
20
  when 'timestamp'
19
21
  @response[name] = Time.parse(@value)
20
22
  end
@@ -12,6 +12,7 @@ module Fog
12
12
  end
13
13
 
14
14
  def start_element(name, attrs = [])
15
+ super
15
16
  case name
16
17
  when 'blockDeviceMapping'
17
18
  @in_block_device_mapping = true
@@ -20,7 +21,6 @@ module Fog
20
21
  when 'productCodes'
21
22
  @in_product_codes = true
22
23
  end
23
- @value = ''
24
24
  end
25
25
 
26
26
  def end_element(name)
@@ -11,12 +11,12 @@ module Fog
11
11
  end
12
12
 
13
13
  def start_element(name, attrs = [])
14
+ super
14
15
  if name == 'previousState'
15
16
  @in_previous_state = true
16
17
  elsif name == 'currentState'
17
18
  @in_current_state = true
18
19
  end
19
- @value = ''
20
20
  end
21
21
 
22
22
  def end_element(name)
@@ -13,6 +13,7 @@ module Fog
13
13
  end
14
14
 
15
15
  def start_element(name, attrs = [])
16
+ super
16
17
  case name
17
18
  when 'ListenerDescriptions'
18
19
  @in_listeners = true
@@ -29,7 +30,6 @@ module Fog
29
30
  when 'AppCookieStickinessPolicies'
30
31
  @in_app_cookies = true
31
32
  end
32
- @value = ''
33
33
  end
34
34
 
35
35
  def end_element(name)
@@ -13,11 +13,12 @@ module Fog
13
13
  end
14
14
 
15
15
  def characters(string)
16
+ @value ||= ''
16
17
  @value << string.strip
17
18
  end
18
19
 
19
20
  def start_element(name, attrs = [])
20
- @value = ''
21
+ @value = nil
21
22
  end
22
23
 
23
24
  end
@@ -10,7 +10,7 @@ module Fog
10
10
  end
11
11
 
12
12
  def start_element(name, attributes)
13
- @value = ''
13
+ super
14
14
  case name
15
15
  when 'CatalogItem'
16
16
  catalog_item = {}
@@ -10,7 +10,7 @@ module Fog
10
10
  end
11
11
 
12
12
  def start_element(name, attributes)
13
- @value = ''
13
+ super
14
14
  case name
15
15
  when 'Entity'
16
16
  until attributes.empty?
@@ -12,7 +12,7 @@ module Fog
12
12
  end
13
13
 
14
14
  def start_element(name, attributes)
15
- @value = ''
15
+ super
16
16
  case name
17
17
  when 'PublicIPAddress'
18
18
  @in_public_ip_address = true
@@ -10,10 +10,6 @@ module Fog
10
10
  @response = { 'IpAddresses' => [] }
11
11
  end
12
12
 
13
- def start_element(name,attributes=[])
14
- @value = ''
15
- end
16
-
17
13
  def end_element(name)
18
14
  case name
19
15
  when 'Name', 'Status', 'Server'
@@ -10,7 +10,7 @@ module Fog
10
10
  end
11
11
 
12
12
  def start_element(name, attributes)
13
- @value = ''
13
+ super
14
14
  case name
15
15
  when 'Link'
16
16
  link = {}
@@ -10,7 +10,7 @@ module Fog
10
10
  end
11
11
 
12
12
  def start_element(name, attributes)
13
- @value = ''
13
+ super
14
14
  if name == 'Org'
15
15
  organization = {}
16
16
  until attributes.empty?
@@ -11,7 +11,7 @@ module Fog
11
11
  end
12
12
 
13
13
  def start_element(name, attributes)
14
- @value = ''
14
+ super
15
15
  case name
16
16
  when 'Owner', 'Result'
17
17
  data = {}
@@ -10,7 +10,7 @@ module Fog
10
10
  end
11
11
 
12
12
  def start_element(name, attributes)
13
- @value = ''
13
+ super
14
14
  case name
15
15
  when 'Link'
16
16
  link = {}
@@ -26,7 +26,7 @@ module Fog
26
26
  end
27
27
 
28
28
  def start_element(name, attributes)
29
- @value = ''
29
+ super
30
30
  case name
31
31
  when 'Cpu'
32
32
  @in_cpu = true
@@ -11,7 +11,7 @@ module Fog
11
11
  end
12
12
 
13
13
  def start_element(name, attributes)
14
- @value = ''
14
+ super
15
15
  case name
16
16
  when 'Link'
17
17
  link = {}
@@ -11,7 +11,7 @@ module Fog
11
11
  end
12
12
 
13
13
  def start_element(name, attributes)
14
- @value = ''
14
+ super
15
15
  case name
16
16
  when 'Href'
17
17
  data = {}
@@ -12,7 +12,7 @@ module Fog
12
12
  end
13
13
 
14
14
  def start_element(name,attributes=[])
15
- @value = ''
15
+ super
16
16
  case name
17
17
  when "Network"
18
18
  until attributes.empty?
@@ -10,7 +10,7 @@ module Fog
10
10
  end
11
11
 
12
12
  def start_element(name, attributes)
13
- @value = ''
13
+ super
14
14
  case name
15
15
  when 'Owner', 'Result'
16
16
  data = {}
@@ -10,7 +10,7 @@ module Fog
10
10
  end
11
11
 
12
12
  def start_element(name, attributes)
13
- @value = ''
13
+ super
14
14
  case name
15
15
  when 'Link'
16
16
  link = {}
@@ -15,7 +15,7 @@ describe 'EC2.create_snapshot' do
15
15
 
16
16
  it "should return proper attributes" do
17
17
  actual = AWS[:ec2].create_snapshot(@volume_id)
18
- actual.body['progress'].should be_a(String)
18
+ actual.body['progress'].should be_nil
19
19
  @snapshot_id = actual.body['snapshotId']
20
20
  actual.body['snapshotId'].should be_a(String)
21
21
  actual.body['startTime'].should be_a(Time)
@@ -13,7 +13,7 @@ describe 'EC2.create_volume' do
13
13
  actual.body['createTime'].should be_a(Time)
14
14
  actual.body['requestId'].should be_a(String)
15
15
  actual.body['size'].should == 1
16
- actual.body['snapshotId'].should == ''
16
+ actual.body['snapshotId'].should be_nil
17
17
  actual.body['status'].should be_a(String)
18
18
  actual.body['volumeId'].should be_a(String)
19
19
  @volume_id = actual.body['volumeId']
@@ -7,6 +7,7 @@ describe 'EC2.describe_instances' do
7
7
  run_instances = AWS[:ec2].run_instances(GENTOO_AMI, 1, 1).body
8
8
  @instance_id = run_instances['instancesSet'].first['instanceId']
9
9
  @reservation_id = run_instances['reservationId']
10
+ Fog.wait_for { AWS[:ec2].servers.get(@instance_id) }
10
11
  AWS[:ec2].servers.get(@instance_id).wait_for { ready? }
11
12
  end
12
13
 
@@ -45,7 +46,9 @@ describe 'EC2.describe_instances' do
45
46
  instance['productCodes'].should be_an(Array)
46
47
  instance['productCodes'].first.should be_a(String) if instance['productCodes'].first
47
48
  instance['ramdiskId'].should be_a(String)
48
- instance['reason'].should be_a(String)
49
+ if instance['reason']
50
+ instance['reason'].should be_a(String)
51
+ end
49
52
  # instance['rootDeviceName'].should be_a(String)
50
53
  instance['rootDeviceType'].should be_a(String)
51
54
  end
@@ -81,7 +84,9 @@ describe 'EC2.describe_instances' do
81
84
  instance['productCodes'].should be_an(Array)
82
85
  instance['productCodes'].first.should be_a(String) if instance['productCodes'].first
83
86
  instance['ramdiskId'].should be_a(String)
84
- instance['reason'].should be_a(String)
87
+ if instance['reason']
88
+ instance['reason'].should be_a(String)
89
+ end
85
90
  # instance['rootDeviceName'].should be_a(String)
86
91
  instance['rootDeviceType'].should be_a(String)
87
92
  end
@@ -18,7 +18,7 @@ describe 'EC2.describe_volumes' do
18
18
  volume['availabilityZone'].should be_a(String)
19
19
  volume['createTime'].should be_a(Time)
20
20
  volume['size'].should == 1
21
- volume['snapshotId'].should == ''
21
+ volume['snapshotId'].should be_nil
22
22
  volume['status'].should be_a(String)
23
23
  volume['volumeId'].should == @volume_id
24
24
  volume['attachmentSet'].should == []
@@ -31,7 +31,7 @@ describe 'EC2.describe_volumes' do
31
31
  volume['availabilityZone'].should be_a(String)
32
32
  volume['createTime'].should be_a(Time)
33
33
  volume['size'].should == 1
34
- volume['snapshotId'].should == ''
34
+ volume['snapshotId'].should be_nil
35
35
  volume['status'].should be_a(String)
36
36
  volume['volumeId'].should == @volume_id
37
37
  volume['attachmentSet'].should == []
@@ -13,11 +13,13 @@ describe 'EC2.get_console_output' do
13
13
  end
14
14
 
15
15
  it "should return proper attributes" do
16
- actual = AWS[:ec2].get_console_output(@instance_id)
17
- actual.body['instanceId'].should be_a(String)
18
- actual.body['output'].should be_a(String)
19
- actual.body['requestId'].should be_a(String)
20
- actual.body['timestamp'].should be_a(Time)
16
+ actual = AWS[:ec2].get_console_output(@instance_id).body
17
+ actual['instanceId'].should be_a(String)
18
+ if actual['output']
19
+ actual['output'].should be_a(String)
20
+ end
21
+ actual['requestId'].should be_a(String)
22
+ actual['timestamp'].should be_a(Time)
21
23
  end
22
24
 
23
25
  end
@@ -18,7 +18,7 @@ describe 'EC2.run_instances' do
18
18
  instance['amiLaunchIndex'].should be_a(Integer)
19
19
  # instance['architecture'].should be_a(String)
20
20
  instance['blockDeviceMapping'].should be_an(Array)
21
- instance['dnsName'].should be_a(String)
21
+ instance['dnsName'].should be_nil
22
22
  instance['imageId'].should be_a(String)
23
23
  instance['instanceId'].should be_a(String)
24
24
  instance['instanceState'].should be_an(Hash)
@@ -33,10 +33,10 @@ describe 'EC2.run_instances' do
33
33
  [false, true].should include(instance['monitoring']['state'])
34
34
  instance['placement'].should be_a(Hash)
35
35
  instance['placement']['availabilityZone'].should be_a(String)
36
- instance['privateDnsName'].should be_a(String)
36
+ instance['privateDnsName'].should be_nil
37
37
  # instance['privateIpAddress'].should be_a(String)
38
38
  instance['ramdiskId'].should be_a(String)
39
- instance['reason'].should be_a(String)
39
+ instance['reason'].should be_nil
40
40
  actual.body['ownerId'].should be_a(String)
41
41
  actual.body['requestId'].should be_a(String)
42
42
  actual.body['reservationId'].should be_a(String)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 89
9
- version: 0.0.89
8
+ - 90
9
+ version: 0.0.90
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-05-04 00:00:00 -07:00
17
+ date: 2010-05-05 00:00:00 -07:00
18
18
  default_executable: fog
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency