fog 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/fog.gemspec +1 -1
- data/lib/fog.rb +15 -4
- data/lib/fog/aws/ec2.rb +10 -2
- data/lib/fog/aws/models/ec2/addresses.rb +1 -1
- data/lib/fog/aws/models/ec2/images.rb +1 -1
- data/lib/fog/aws/models/ec2/key_pairs.rb +1 -1
- data/lib/fog/aws/models/ec2/security_groups.rb +1 -1
- data/lib/fog/aws/models/ec2/servers.rb +1 -1
- data/lib/fog/aws/models/ec2/snapshots.rb +1 -1
- data/lib/fog/aws/models/ec2/volumes.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_reserved_instances.rb +1 -1
- data/lib/fog/aws/requests/ec2/modify_image_attributes.rb +1 -1
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/delete_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/describe_instance_health.rb +1 -1
- data/lib/fog/aws/requests/elb/describe_load_balancers.rb +1 -1
- data/lib/fog/aws/requests/elb/disable_availability_zones_for_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/enable_availability_zones_for_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/s3/get_bucket_acl.rb +1 -1
- data/lib/fog/aws/requests/s3/get_bucket_logging.rb +1 -1
- data/lib/fog/aws/requests/s3/get_bucket_object_versions.rb +1 -1
- data/lib/fog/aws/requests/s3/get_bucket_versioning.rb +1 -1
- data/lib/fog/aws/requests/s3/get_object_acl.rb +1 -1
- data/lib/fog/aws/requests/s3/get_object_torrent.rb +1 -1
- data/lib/fog/aws/requests/s3/put_bucket_acl.rb +1 -1
- data/lib/fog/aws/requests/s3/put_bucket_logging.rb +1 -1
- data/lib/fog/aws/requests/s3/put_bucket_versioning.rb +1 -1
- data/lib/fog/aws/requests/simpledb/select.rb +1 -1
- data/lib/fog/rackspace/requests/files/delete_container.rb +1 -1
- data/lib/fog/rackspace/requests/files/delete_object.rb +1 -1
- data/lib/fog/rackspace/requests/files/get_container.rb +1 -1
- data/lib/fog/rackspace/requests/files/get_containers.rb +1 -1
- data/lib/fog/rackspace/requests/files/get_object.rb +1 -1
- data/lib/fog/rackspace/requests/files/head_container.rb +1 -1
- data/lib/fog/rackspace/requests/files/head_containers.rb +1 -1
- data/lib/fog/rackspace/requests/files/head_object.rb +1 -1
- data/lib/fog/rackspace/requests/files/put_container.rb +1 -1
- data/lib/fog/rackspace/requests/files/put_object.rb +1 -1
- data/lib/fog/rackspace/requests/servers/get_flavor_details.rb +1 -1
- data/lib/fog/rackspace/requests/servers/get_image_details.rb +1 -1
- data/lib/fog/rackspace/requests/servers/list_flavors.rb +1 -1
- data/lib/fog/rackspace/requests/servers/list_flavors_detail.rb +1 -1
- data/lib/fog/rackspace/requests/servers/reboot_server.rb +1 -1
- data/lib/fog/slicehost/requests/create_slice.rb +1 -1
- data/lib/fog/slicehost/requests/delete_slice.rb +1 -1
- data/lib/fog/slicehost/requests/get_backups.rb +1 -1
- data/lib/fog/slicehost/requests/get_flavor.rb +1 -1
- data/lib/fog/slicehost/requests/get_flavors.rb +1 -1
- data/lib/fog/slicehost/requests/get_image.rb +1 -1
- data/lib/fog/slicehost/requests/get_images.rb +1 -1
- data/lib/fog/slicehost/requests/get_slice.rb +1 -1
- data/lib/fog/slicehost/requests/get_slices.rb +1 -1
- data/lib/fog/slicehost/requests/reboot_slice.rb +1 -1
- data/lib/fog/ssh.rb +1 -1
- data/lib/fog/terremark/requests/shared/add_internet_service.rb +1 -1
- data/lib/fog/terremark/requests/shared/add_node_service.rb +1 -1
- data/lib/fog/terremark/requests/shared/create_internet_service.rb +1 -1
- data/lib/fog/terremark/requests/shared/delete_internet_service.rb +1 -1
- data/lib/fog/terremark/requests/shared/delete_node_service.rb +1 -1
- data/lib/fog/terremark/requests/shared/delete_public_ip.rb +1 -1
- data/lib/fog/terremark/requests/shared/delete_vapp.rb +1 -1
- data/lib/fog/terremark/requests/shared/deploy_vapp.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_catalog.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_catalog_item.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_internet_services.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_network_ips.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_node_services.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_public_ip.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_task.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_tasks_list.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_vapp.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_vapp_template.rb +1 -1
- data/lib/fog/terremark/requests/shared/instantiate_vapp_template.rb +1 -1
- data/lib/fog/terremark/requests/shared/power_off.rb +1 -1
- data/lib/fog/terremark/requests/shared/power_on.rb +1 -1
- data/lib/fog/terremark/requests/shared/power_reset.rb +1 -1
- data/lib/fog/terremark/requests/shared/power_shutdown.rb +1 -1
- data/tests/aws/helper.rb +0 -89
- data/tests/aws/requests/ec2/address_tests.rb +10 -2
- data/tests/aws/requests/ec2/availability_zone_tests.rb +11 -2
- data/tests/aws/requests/ec2/key_pair_tests.rb +18 -3
- data/tests/aws/requests/ec2/region_tests.rb +10 -2
- data/tests/aws/requests/ec2/security_group_tests.rb +18 -2
- data/tests/aws/requests/ec2/snapshot_tests.rb +21 -4
- data/tests/aws/requests/ec2/volume_tests.rb +43 -8
- data/tests/helper_tests.rb +7 -36
- metadata +2 -2
data/fog.gemspec
CHANGED
@@ -7,7 +7,7 @@ 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.1.
|
10
|
+
s.version = '0.1.4'
|
11
11
|
s.date = '2010-05-26'
|
12
12
|
s.rubyforge_project = 'fog'
|
13
13
|
|
data/lib/fog.rb
CHANGED
@@ -26,7 +26,15 @@ require 'fog/parser'
|
|
26
26
|
require 'fog/ssh'
|
27
27
|
|
28
28
|
module Fog
|
29
|
-
|
29
|
+
module Errors
|
30
|
+
|
31
|
+
class Error < StandardError; end
|
32
|
+
|
33
|
+
class MockNotImplemented < Fog::Errors::Error; end
|
34
|
+
|
35
|
+
class NotFound < Fog::Errors::Error; end
|
36
|
+
|
37
|
+
end
|
30
38
|
end
|
31
39
|
|
32
40
|
require 'fog/aws'
|
@@ -38,10 +46,8 @@ require 'fog/vcloud'
|
|
38
46
|
|
39
47
|
module Fog
|
40
48
|
|
41
|
-
class MockNotImplemented < Fog::Error; end
|
42
|
-
|
43
49
|
unless const_defined?(:VERSION)
|
44
|
-
VERSION = '0.1.
|
50
|
+
VERSION = '0.1.4'
|
45
51
|
end
|
46
52
|
|
47
53
|
module Mock
|
@@ -54,6 +60,11 @@ module Fog
|
|
54
60
|
raise ArgumentError, "delay must be non-negative" unless new_delay >= 0
|
55
61
|
@delay = new_delay
|
56
62
|
end
|
63
|
+
|
64
|
+
def self.not_implemented
|
65
|
+
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
|
66
|
+
end
|
67
|
+
|
57
68
|
end
|
58
69
|
|
59
70
|
def self.mock!
|
data/lib/fog/aws/ec2.rb
CHANGED
@@ -2,7 +2,8 @@ module Fog
|
|
2
2
|
module AWS
|
3
3
|
module EC2
|
4
4
|
|
5
|
-
class Error < Fog::Error; end
|
5
|
+
class Error < Fog::Errors::Error; end
|
6
|
+
class NotFound < Fog::Errors::NotFound; end
|
6
7
|
|
7
8
|
def self.new(options={})
|
8
9
|
|
@@ -226,7 +227,14 @@ module Fog
|
|
226
227
|
})
|
227
228
|
rescue Excon::Errors::Error => error
|
228
229
|
if match = error.message.match(/<Code>(.*)<\/Code><Message>(.*)<\/Message>/)
|
229
|
-
|
230
|
+
new_error = case match[1].split('.').last
|
231
|
+
when 'NotFound'
|
232
|
+
Fog::AWS::EC2::NotFound.new(match[2])
|
233
|
+
else
|
234
|
+
Fog::AWS::EC2::Error.new("#{match[1]} => #{match[2]}")
|
235
|
+
end
|
236
|
+
new_error.set_backtrace(error.backtrace)
|
237
|
+
raise new_error
|
230
238
|
else
|
231
239
|
raise error
|
232
240
|
end
|
@@ -33,7 +33,7 @@ module Fog
|
|
33
33
|
class Mock
|
34
34
|
|
35
35
|
def deregister_instances_from_load_balancer(instance_ids, lb_name)
|
36
|
-
|
36
|
+
Fog::Mock.not_implemented
|
37
37
|
end
|
38
38
|
|
39
39
|
alias :deregister_instances :deregister_instances_from_load_balancer
|
@@ -32,7 +32,7 @@ module Fog
|
|
32
32
|
class Mock
|
33
33
|
|
34
34
|
def disable_availability_zones_for_load_balancer(availability_zones, lb_name)
|
35
|
-
|
35
|
+
Fog::Mock.not_implemented
|
36
36
|
end
|
37
37
|
|
38
38
|
alias :disable_zones :disable_availability_zones_for_load_balancer
|
@@ -32,7 +32,7 @@ module Fog
|
|
32
32
|
class Mock
|
33
33
|
|
34
34
|
def enable_availability_zones_for_load_balancer(availability_zones, lb_name)
|
35
|
-
|
35
|
+
Fog::Mock.not_implemented
|
36
36
|
end
|
37
37
|
|
38
38
|
alias :enable_zones :enable_availability_zones_for_load_balancer
|
@@ -33,7 +33,7 @@ module Fog
|
|
33
33
|
class Mock
|
34
34
|
|
35
35
|
def register_instances_with_load_balancer(instance_ids, lb_name)
|
36
|
-
|
36
|
+
Fog::Mock.not_implemented
|
37
37
|
end
|
38
38
|
|
39
39
|
alias :register_instances :register_instances_with_load_balancer
|