fog 0.0.41 → 0.0.42
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.
- data/README.rdoc +4 -5
- data/Rakefile +1 -0
- data/VERSION.yml +5 -0
- data/fog.gemspec +11 -4
- data/lib/fog.rb +8 -7
- data/lib/fog/aws.rb +8 -0
- data/lib/fog/aws/ec2.rb +1 -10
- data/lib/fog/aws/models/ec2/server.rb +2 -2
- data/lib/fog/aws/requests/ec2/describe_addresses.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_availability_zones.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_images.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_instances.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_key_pairs.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_regions.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_security_groups.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_snapshots.rb +1 -1
- data/lib/fog/aws/requests/ec2/describe_volumes.rb +1 -1
- data/lib/fog/aws/requests/ec2/reboot_instances.rb +1 -1
- data/lib/fog/aws/requests/ec2/terminate_instances.rb +1 -1
- data/lib/fog/aws/s3.rb +1 -1
- data/lib/fog/aws/simpledb.rb +2 -10
- data/lib/fog/slicehost.rb +1 -1
- data/spec/aws/models/ec2/servers_spec.rb +6 -37
- data/spec/rackspace/models/servers/server_spec.rb +1 -1
- data/spec/rackspace/models/servers/servers_spec.rb +22 -0
- data/spec/shared_examples/server_examples.rb +1 -0
- data/spec/shared_examples/servers_examples.rb +37 -0
- metadata +17 -3
- data/VERSION +0 -1
data/README.rdoc
CHANGED
@@ -104,12 +104,11 @@ Now we will try again, but with Rackspace
|
|
104
104
|
# delete the directory
|
105
105
|
directory.destroy
|
106
106
|
|
107
|
-
==
|
107
|
+
== More info
|
108
108
|
|
109
|
-
*
|
110
|
-
*
|
111
|
-
*
|
112
|
-
* nokogiri
|
109
|
+
* Follow {@geemus}[http://twitter.com/geemus] on Twitter.
|
110
|
+
* See upcoming work in the {tracker}[http://www.pivotaltracker.com/projects/54635].
|
111
|
+
* Report bugs in {issues}[http://github.com/geemus/fog/issues].
|
113
112
|
|
114
113
|
== Supports
|
115
114
|
|
data/Rakefile
CHANGED
data/VERSION.yml
ADDED
data/fog.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in
|
3
|
+
# Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fog}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.42"
|
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-01
|
12
|
+
s.date = %q{2010-02-01}
|
13
13
|
s.default_executable = %q{fog}
|
14
14
|
s.description = %q{brings clouds to you}
|
15
15
|
s.email = %q{me@geemus.com}
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
".gitignore",
|
23
23
|
"README.rdoc",
|
24
24
|
"Rakefile",
|
25
|
-
"VERSION",
|
25
|
+
"VERSION.yml",
|
26
26
|
"benchs/fog_vs.rb",
|
27
27
|
"benchs/params.rb",
|
28
28
|
"benchs/parse_vs_push.rb",
|
@@ -251,6 +251,7 @@ Gem::Specification.new do |s|
|
|
251
251
|
"spec/compact_progress_bar_formatter.rb",
|
252
252
|
"spec/lorem.txt",
|
253
253
|
"spec/rackspace/models/servers/server_spec.rb",
|
254
|
+
"spec/rackspace/models/servers/servers_spec.rb",
|
254
255
|
"spec/rackspace/requests/files/delete_container_spec.rb",
|
255
256
|
"spec/rackspace/requests/files/delete_object_spec.rb",
|
256
257
|
"spec/rackspace/requests/files/get_container_spec.rb",
|
@@ -277,6 +278,7 @@ Gem::Specification.new do |s|
|
|
277
278
|
"spec/rackspace/requests/servers/reboot_server_spec.rb",
|
278
279
|
"spec/rackspace/requests/servers/update_server_spec.rb",
|
279
280
|
"spec/shared_examples/server_examples.rb",
|
281
|
+
"spec/shared_examples/servers_examples.rb",
|
280
282
|
"spec/slicehost/requests/create_slice_spec.rb",
|
281
283
|
"spec/slicehost/requests/delete_slice_spec.rb",
|
282
284
|
"spec/slicehost/requests/get_backups_spec.rb",
|
@@ -393,6 +395,7 @@ Gem::Specification.new do |s|
|
|
393
395
|
"spec/aws/requests/simpledb/select_spec.rb",
|
394
396
|
"spec/compact_progress_bar_formatter.rb",
|
395
397
|
"spec/rackspace/models/servers/server_spec.rb",
|
398
|
+
"spec/rackspace/models/servers/servers_spec.rb",
|
396
399
|
"spec/rackspace/requests/files/delete_container_spec.rb",
|
397
400
|
"spec/rackspace/requests/files/delete_object_spec.rb",
|
398
401
|
"spec/rackspace/requests/files/get_container_spec.rb",
|
@@ -419,6 +422,7 @@ Gem::Specification.new do |s|
|
|
419
422
|
"spec/rackspace/requests/servers/reboot_server_spec.rb",
|
420
423
|
"spec/rackspace/requests/servers/update_server_spec.rb",
|
421
424
|
"spec/shared_examples/server_examples.rb",
|
425
|
+
"spec/shared_examples/servers_examples.rb",
|
422
426
|
"spec/slicehost/requests/create_slice_spec.rb",
|
423
427
|
"spec/slicehost/requests/delete_slice_spec.rb",
|
424
428
|
"spec/slicehost/requests/get_backups_spec.rb",
|
@@ -434,17 +438,20 @@ Gem::Specification.new do |s|
|
|
434
438
|
|
435
439
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
436
440
|
s.add_runtime_dependency(%q<excon>, [">= 0.0.18"])
|
441
|
+
s.add_runtime_dependency(%q<json>, [">= 0"])
|
437
442
|
s.add_runtime_dependency(%q<mime-types>, [">= 0"])
|
438
443
|
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
439
444
|
s.add_runtime_dependency(%q<ruby-hmac>, [">= 0"])
|
440
445
|
else
|
441
446
|
s.add_dependency(%q<excon>, [">= 0.0.18"])
|
447
|
+
s.add_dependency(%q<json>, [">= 0"])
|
442
448
|
s.add_dependency(%q<mime-types>, [">= 0"])
|
443
449
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
444
450
|
s.add_dependency(%q<ruby-hmac>, [">= 0"])
|
445
451
|
end
|
446
452
|
else
|
447
453
|
s.add_dependency(%q<excon>, [">= 0.0.18"])
|
454
|
+
s.add_dependency(%q<json>, [">= 0"])
|
448
455
|
s.add_dependency(%q<mime-types>, [">= 0"])
|
449
456
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
450
457
|
s.add_dependency(%q<ruby-hmac>, [">= 0"])
|
data/lib/fog.rb
CHANGED
@@ -57,19 +57,20 @@ module Fog
|
|
57
57
|
else
|
58
58
|
nil
|
59
59
|
end
|
60
|
-
unless credentials
|
61
|
-
print("\n To run as '#{
|
60
|
+
unless credentials && credentials[credential]
|
61
|
+
print("\n To run as '#{credential}', add credentials like the following to ~/.fog\n")
|
62
62
|
yml = <<-YML
|
63
63
|
|
64
|
-
:#{
|
65
|
-
:aws_access_key_id:
|
64
|
+
:#{credential}:
|
65
|
+
:aws_access_key_id: INTENTIONALLY_LEFT_BLANK
|
66
66
|
:aws_secret_access_key: INTENTIONALLY_LEFT_BLANK
|
67
|
-
:rackspace_api_key:
|
68
|
-
:rackspace_username:
|
69
|
-
:slicehost_password:
|
67
|
+
:rackspace_api_key: INTENTIONALLY_LEFT_BLANK
|
68
|
+
:rackspace_username: INTENTIONALLY_LEFT_BLANK
|
69
|
+
:slicehost_password: INTENTIONALLY_LEFT_BLANK
|
70
70
|
|
71
71
|
YML
|
72
72
|
print(yml)
|
73
|
+
raise(ArgumentError.new("Missing Credentials"))
|
73
74
|
end
|
74
75
|
credentials[credential]
|
75
76
|
end
|
data/lib/fog/aws.rb
CHANGED
@@ -7,6 +7,14 @@ module Fog
|
|
7
7
|
load "fog/aws/s3.rb"
|
8
8
|
end
|
9
9
|
|
10
|
+
def self.indexed_param(key, values)
|
11
|
+
params = {}
|
12
|
+
[*values].each_with_index do |value, index|
|
13
|
+
params["#{key}.#{index}"] = value
|
14
|
+
end
|
15
|
+
params
|
16
|
+
end
|
17
|
+
|
10
18
|
if Fog.mocking?
|
11
19
|
srand(Time.now.to_i)
|
12
20
|
|
data/lib/fog/aws/ec2.rb
CHANGED
@@ -137,21 +137,12 @@ module Fog
|
|
137
137
|
@host = options[:host] || 'ec2.amazonaws.com'
|
138
138
|
@port = options[:port] || 443
|
139
139
|
@scheme = options[:scheme] || 'https'
|
140
|
-
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}")
|
141
140
|
end
|
142
141
|
|
143
142
|
private
|
144
143
|
|
145
|
-
def indexed_params(name, params)
|
146
|
-
indexed, index = {}, 1
|
147
|
-
for param in [*params]
|
148
|
-
indexed["#{name}.#{index}"] = param
|
149
|
-
index += 1
|
150
|
-
end
|
151
|
-
indexed
|
152
|
-
end
|
153
|
-
|
154
144
|
def request(params, parser)
|
145
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}")
|
155
146
|
params.merge!({
|
156
147
|
'AWSAccessKeyId' => @aws_access_key_id,
|
157
148
|
'SignatureMethod' => 'HmacSHA256',
|
@@ -104,8 +104,8 @@ module Fog
|
|
104
104
|
if @availability_zone
|
105
105
|
options['Placement.AvailabilityZone'] = @availability_zone
|
106
106
|
end
|
107
|
-
@groups.
|
108
|
-
options
|
107
|
+
unless @groups.empty?
|
108
|
+
options.merge!(AWS.indexed_param("SecurityGroup", @groups))
|
109
109
|
end
|
110
110
|
if @kernel_id
|
111
111
|
options['KernelId'] = @kernel_id
|
@@ -17,7 +17,7 @@ unless Fog.mocking?
|
|
17
17
|
# * 'instanceId'<~String> - instance for ip address
|
18
18
|
# * 'publicIp'<~String> - ip address for instance
|
19
19
|
def describe_addresses(public_ip = [])
|
20
|
-
params =
|
20
|
+
params = AWS.indexed_param('PublicIp', public_ip)
|
21
21
|
request({
|
22
22
|
'Action' => 'DescribeAddresses'
|
23
23
|
}.merge!(params), Fog::Parsers::AWS::EC2::DescribeAddresses.new)
|
@@ -18,7 +18,7 @@ unless Fog.mocking?
|
|
18
18
|
# * 'zoneName'<~String> - Name of zone
|
19
19
|
# * 'zoneState'<~String> - State of zone
|
20
20
|
def describe_availability_zones(zone_name = [])
|
21
|
-
params =
|
21
|
+
params = AWS.indexed_param('ZoneName', zone_name)
|
22
22
|
request({
|
23
23
|
'Action' => 'DescribeAvailabilityZones'
|
24
24
|
}.merge!(params), Fog::Parsers::AWS::EC2::DescribeAvailabilityZones.new)
|
@@ -31,7 +31,7 @@ unless Fog.mocking?
|
|
31
31
|
# * 'ramdiskId'<~String> - Ramdisk id associated with image, if any
|
32
32
|
def describe_images(options = {})
|
33
33
|
if image_id = options.delete('ImageId')
|
34
|
-
options.merge!(
|
34
|
+
options.merge!(AWS.indexed_param('ImageId', image_id))
|
35
35
|
end
|
36
36
|
request({
|
37
37
|
'Action' => 'DescribeImages'
|
@@ -39,7 +39,7 @@ unless Fog.mocking?
|
|
39
39
|
# * 'ramdiskId'<~String> - Id of ramdisk used to launch instance
|
40
40
|
# * 'reason'<~String> - reason for most recent state transition, or blank
|
41
41
|
def describe_instances(instance_id = [])
|
42
|
-
params =
|
42
|
+
params = AWS.indexed_param('InstanceId', instance_id)
|
43
43
|
request({
|
44
44
|
'Action' => 'DescribeInstances'
|
45
45
|
}.merge!(params), Fog::Parsers::AWS::EC2::DescribeInstances.new)
|
@@ -17,7 +17,7 @@ unless Fog.mocking?
|
|
17
17
|
# * 'keyName'<~String> - Name of key
|
18
18
|
# * 'keyFingerprint'<~String> - Fingerprint of key
|
19
19
|
def describe_key_pairs(key_name = [])
|
20
|
-
params =
|
20
|
+
params = AWS.indexed_param('KeyName', key_name)
|
21
21
|
request({
|
22
22
|
'Action' => 'DescribeKeyPairs'
|
23
23
|
}.merge!(params), Fog::Parsers::AWS::EC2::DescribeKeyPairs.new)
|
@@ -17,7 +17,7 @@ unless Fog.mocking?
|
|
17
17
|
# * 'regionName'<~String> - Name of region
|
18
18
|
# * 'regionEndpoint'<~String> - Service endpoint for region
|
19
19
|
def describe_regions(region_name = [])
|
20
|
-
params =
|
20
|
+
params = AWS.indexed_param('RegionName', region_name)
|
21
21
|
request({
|
22
22
|
'Action' => 'DescribeRegions'
|
23
23
|
}.merge!(params), Fog::Parsers::AWS::EC2::DescribeRegions.new)
|
@@ -27,7 +27,7 @@ unless Fog.mocking?
|
|
27
27
|
# * 'toPort'<~Integer> - End of port range (or -1 for ICMP wildcard)
|
28
28
|
# * 'ownerId'<~String> - AWS Access Key Id of the owner of the security group
|
29
29
|
def describe_security_groups(group_name = [])
|
30
|
-
params =
|
30
|
+
params = AWS.indexed_param('GroupName', group_name)
|
31
31
|
request({
|
32
32
|
'Action' => 'DescribeSecurityGroups',
|
33
33
|
}.merge!(params), Fog::Parsers::AWS::EC2::DescribeSecurityGroups.new)
|
@@ -20,7 +20,7 @@ unless Fog.mocking?
|
|
20
20
|
# * 'status'<~String>: Snapshot state, in ['pending', 'completed']
|
21
21
|
# * 'volumeId'<~String>: Id of volume that snapshot contains
|
22
22
|
def describe_snapshots(snapshot_id = [])
|
23
|
-
params =
|
23
|
+
params = AWS.indexed_param('SnapshotId', snapshot_id)
|
24
24
|
request({
|
25
25
|
'Action' => 'DescribeSnapshots'
|
26
26
|
}.merge!(params), Fog::Parsers::AWS::EC2::DescribeSnapshots.new)
|
@@ -26,7 +26,7 @@ unless Fog.mocking?
|
|
26
26
|
# * 'status'<~String> - Attachment state
|
27
27
|
# * 'volumeId'<~String> - Reference to volume
|
28
28
|
def describe_volumes(volume_id = [])
|
29
|
-
params =
|
29
|
+
params = AWS.indexed_param('VolumeId', volume_id)
|
30
30
|
request({
|
31
31
|
'Action' => 'DescribeVolumes'
|
32
32
|
}.merge!(params), Fog::Parsers::AWS::EC2::DescribeVolumes.new)
|
@@ -15,7 +15,7 @@ unless Fog.mocking?
|
|
15
15
|
# * 'requestId'<~String> - Id of request
|
16
16
|
# * 'return'<~Boolean> - success?
|
17
17
|
def reboot_instances(instance_id = [])
|
18
|
-
params =
|
18
|
+
params = AWS.indexed_param('InstanceId', instance_id)
|
19
19
|
request({
|
20
20
|
'Action' => 'RebootInstances'
|
21
21
|
}.merge!(params), Fog::Parsers::AWS::EC2::Basic.new)
|
@@ -22,7 +22,7 @@ unless Fog.mocking?
|
|
22
22
|
# * 'code'<~Integer> - current status code
|
23
23
|
# * 'name'<~String> - name of current state
|
24
24
|
def terminate_instances(instance_id)
|
25
|
-
params =
|
25
|
+
params = AWS.indexed_param('InstanceId', instance_id)
|
26
26
|
request({
|
27
27
|
'Action' => 'TerminateInstances'
|
28
28
|
}.merge!(params), Fog::Parsers::AWS::EC2::TerminateInstances.new)
|
data/lib/fog/aws/s3.rb
CHANGED
@@ -69,7 +69,6 @@ module Fog
|
|
69
69
|
@host = options[:host] || 's3.amazonaws.com'
|
70
70
|
@port = options[:port] || 443
|
71
71
|
@scheme = options[:scheme] || 'https'
|
72
|
-
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}")
|
73
72
|
end
|
74
73
|
|
75
74
|
private
|
@@ -96,6 +95,7 @@ module Fog
|
|
96
95
|
end
|
97
96
|
|
98
97
|
def request(params)
|
98
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}")
|
99
99
|
params[:headers]['Date'] = Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S +0000")
|
100
100
|
params[:headers]['Authorization'] = "AWS #{@aws_access_key_id}:#{signature(params)}"
|
101
101
|
|
data/lib/fog/aws/simpledb.rb
CHANGED
@@ -58,7 +58,6 @@ module Fog
|
|
58
58
|
@nil_string = options[:nil_string]|| 'nil'
|
59
59
|
@port = options[:port] || 443
|
60
60
|
@scheme = options[:scheme] || 'https'
|
61
|
-
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}")
|
62
61
|
end
|
63
62
|
|
64
63
|
private
|
@@ -82,15 +81,7 @@ module Fog
|
|
82
81
|
end
|
83
82
|
|
84
83
|
def encode_attribute_names(attributes)
|
85
|
-
|
86
|
-
if attributes
|
87
|
-
index = 0
|
88
|
-
for attribute in attributes
|
89
|
-
encoded_attribute_names["AttributeName.#{index}"] = attribute.to_s
|
90
|
-
index += 1
|
91
|
-
end
|
92
|
-
end
|
93
|
-
encoded_attribute_names
|
84
|
+
AWS.indexed_param('AttributeName', attributes.map {|attribute| attributes.to_s})
|
94
85
|
end
|
95
86
|
|
96
87
|
def encode_batch_attributes(items, replace_attributes = Hash.new([]))
|
@@ -117,6 +108,7 @@ module Fog
|
|
117
108
|
end
|
118
109
|
|
119
110
|
def request(params, parser)
|
111
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}")
|
120
112
|
params.merge!({
|
121
113
|
'AWSAccessKeyId' => @aws_access_key_id,
|
122
114
|
'SignatureMethod' => 'HmacSHA256',
|
data/lib/fog/slicehost.rb
CHANGED
@@ -36,10 +36,10 @@ module Fog
|
|
36
36
|
@host = options[:host] || "api.slicehost.com"
|
37
37
|
@port = options[:port] || 443
|
38
38
|
@scheme = options[:scheme] || 'https'
|
39
|
-
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}")
|
40
39
|
end
|
41
40
|
|
42
41
|
def request(params)
|
42
|
+
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}")
|
43
43
|
headers = {
|
44
44
|
'Authorization' => "Basic #{Base64.encode64(@password).gsub("\n",'')}"
|
45
45
|
}
|
@@ -1,8 +1,11 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + '/../../../shared_examples/servers_examples'
|
2
3
|
|
3
4
|
describe 'Fog::AWS::EC2::Servers' do
|
4
5
|
|
5
|
-
|
6
|
+
it_should_behave_like "Servers"
|
7
|
+
|
8
|
+
subject { @server = @servers.new(:image_id => GENTOO_AMI) }
|
6
9
|
|
7
10
|
before(:each) do
|
8
11
|
@servers = AWS[:ec2].servers
|
@@ -10,43 +13,9 @@ describe 'Fog::AWS::EC2::Servers' do
|
|
10
13
|
|
11
14
|
after(:each) do
|
12
15
|
if @server && !@server.new_record?
|
13
|
-
@server.
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "#all" do
|
18
|
-
|
19
|
-
it "should include persisted servers" do
|
20
|
-
eventually do
|
21
|
-
@servers.all.map {|server| server.id}.should include(subject.id)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
|
27
|
-
describe "#get" do
|
28
|
-
|
29
|
-
it "should return a matching server if one exists" do
|
30
|
-
eventually do
|
31
|
-
get = @servers.get(subject.id)
|
32
|
-
subject.attributes.should == get.attributes
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should return nil if no matching server exists" do
|
37
|
-
@servers.get('i-00000000').should be_nil
|
16
|
+
@server.wait_for { ready? }
|
17
|
+
@server.destroy.should be_true
|
38
18
|
end
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
describe "#reload" do
|
43
|
-
|
44
|
-
it "should reset attributes to remote state" do
|
45
|
-
servers = @servers.all
|
46
|
-
reloaded = servers.reload
|
47
|
-
servers.attributes.should == reloaded.attributes
|
48
|
-
end
|
49
|
-
|
50
19
|
end
|
51
20
|
|
52
21
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + '/../../../shared_examples/servers_examples'
|
3
|
+
|
4
|
+
describe 'Fog::Rackspace::Servers::Servers' do
|
5
|
+
|
6
|
+
it_should_behave_like "Servers"
|
7
|
+
|
8
|
+
# flavor 1 = 256, image 3 = gentoo 2008.0
|
9
|
+
subject { @server = @servers.new(:flavor_id => 1, :image_id => 3, :name => 'name') }
|
10
|
+
|
11
|
+
before(:each) do
|
12
|
+
@servers = Rackspace[:servers].servers
|
13
|
+
end
|
14
|
+
|
15
|
+
after(:each) do
|
16
|
+
if @server && !@server.new_record?
|
17
|
+
@server.wait_for { ready? }
|
18
|
+
@server.destroy.should be_true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
shared_examples_for "Servers" do
|
2
|
+
|
3
|
+
describe "#all" do
|
4
|
+
|
5
|
+
it "should include persisted servers" do
|
6
|
+
subject.save
|
7
|
+
@servers.all.map {|server| server.id}.should include(subject.id)
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "#get" do
|
13
|
+
|
14
|
+
it "should return a matching server if one exists" do
|
15
|
+
subject.save
|
16
|
+
get = @servers.get(subject.id)
|
17
|
+
subject.attributes.should == get.attributes
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should return nil if no matching server exists" do
|
21
|
+
@servers.get('0').should be_nil
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "#reload" do
|
27
|
+
|
28
|
+
it "should reset attributes to remote state" do
|
29
|
+
subject.save
|
30
|
+
servers = @servers.all
|
31
|
+
reloaded = servers.reload
|
32
|
+
servers.attributes.should == reloaded.attributes
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- geemus (Wesley Beary)
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01
|
12
|
+
date: 2010-02-01 00:00:00 -08:00
|
13
13
|
default_executable: fog
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,6 +22,16 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 0.0.18
|
24
24
|
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: json
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
25
35
|
- !ruby/object:Gem::Dependency
|
26
36
|
name: mime-types
|
27
37
|
type: :runtime
|
@@ -65,7 +75,7 @@ files:
|
|
65
75
|
- .gitignore
|
66
76
|
- README.rdoc
|
67
77
|
- Rakefile
|
68
|
-
- VERSION
|
78
|
+
- VERSION.yml
|
69
79
|
- benchs/fog_vs.rb
|
70
80
|
- benchs/params.rb
|
71
81
|
- benchs/parse_vs_push.rb
|
@@ -294,6 +304,7 @@ files:
|
|
294
304
|
- spec/compact_progress_bar_formatter.rb
|
295
305
|
- spec/lorem.txt
|
296
306
|
- spec/rackspace/models/servers/server_spec.rb
|
307
|
+
- spec/rackspace/models/servers/servers_spec.rb
|
297
308
|
- spec/rackspace/requests/files/delete_container_spec.rb
|
298
309
|
- spec/rackspace/requests/files/delete_object_spec.rb
|
299
310
|
- spec/rackspace/requests/files/get_container_spec.rb
|
@@ -320,6 +331,7 @@ files:
|
|
320
331
|
- spec/rackspace/requests/servers/reboot_server_spec.rb
|
321
332
|
- spec/rackspace/requests/servers/update_server_spec.rb
|
322
333
|
- spec/shared_examples/server_examples.rb
|
334
|
+
- spec/shared_examples/servers_examples.rb
|
323
335
|
- spec/slicehost/requests/create_slice_spec.rb
|
324
336
|
- spec/slicehost/requests/delete_slice_spec.rb
|
325
337
|
- spec/slicehost/requests/get_backups_spec.rb
|
@@ -457,6 +469,7 @@ test_files:
|
|
457
469
|
- spec/aws/requests/simpledb/select_spec.rb
|
458
470
|
- spec/compact_progress_bar_formatter.rb
|
459
471
|
- spec/rackspace/models/servers/server_spec.rb
|
472
|
+
- spec/rackspace/models/servers/servers_spec.rb
|
460
473
|
- spec/rackspace/requests/files/delete_container_spec.rb
|
461
474
|
- spec/rackspace/requests/files/delete_object_spec.rb
|
462
475
|
- spec/rackspace/requests/files/get_container_spec.rb
|
@@ -483,6 +496,7 @@ test_files:
|
|
483
496
|
- spec/rackspace/requests/servers/reboot_server_spec.rb
|
484
497
|
- spec/rackspace/requests/servers/update_server_spec.rb
|
485
498
|
- spec/shared_examples/server_examples.rb
|
499
|
+
- spec/shared_examples/servers_examples.rb
|
486
500
|
- spec/slicehost/requests/create_slice_spec.rb
|
487
501
|
- spec/slicehost/requests/delete_slice_spec.rb
|
488
502
|
- spec/slicehost/requests/get_backups_spec.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.41
|