fog 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/fog.gemspec +1 -1
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/compute.rb +45 -42
- data/lib/fog/aws/storage.rb +8 -5
- metadata +2 -2
data/Gemfile.lock
CHANGED
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.3.
|
10
|
+
s.version = '0.3.3'
|
11
11
|
s.date = '2010-09-24'
|
12
12
|
s.rubyforge_project = 'fog'
|
13
13
|
|
data/lib/fog.rb
CHANGED
data/lib/fog/aws/compute.rb
CHANGED
@@ -67,48 +67,50 @@ module Fog
|
|
67
67
|
class Mock
|
68
68
|
|
69
69
|
def self.data
|
70
|
-
@data ||= Hash.new do |hash,
|
70
|
+
@data ||= Hash.new do |hash, region|
|
71
71
|
owner_id = Fog::AWS::Mock.owner_id
|
72
|
-
hash[
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
'
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
72
|
+
hash[region] = Hash.new do |hash, key|
|
73
|
+
hash[key] = {
|
74
|
+
:deleted_at => {},
|
75
|
+
:addresses => {},
|
76
|
+
:instances => {},
|
77
|
+
:key_pairs => {},
|
78
|
+
:limits => { :addresses => 5 },
|
79
|
+
:owner_id => owner_id,
|
80
|
+
:security_groups => {
|
81
|
+
'default' => {
|
82
|
+
'groupDescription' => 'default group',
|
83
|
+
'groupName' => 'default',
|
84
|
+
'ipPermissions' => [
|
85
|
+
{
|
86
|
+
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
87
|
+
'fromPort' => -1,
|
88
|
+
'toPort' => -1,
|
89
|
+
'ipProtocol' => 'icmp',
|
90
|
+
'ipRanges' => []
|
91
|
+
},
|
92
|
+
{
|
93
|
+
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
94
|
+
'fromPort' => 0,
|
95
|
+
'toPort' => 65535,
|
96
|
+
'ipProtocol' => 'tcp',
|
97
|
+
'ipRanges' => []
|
98
|
+
},
|
99
|
+
{
|
100
|
+
'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
|
101
|
+
'fromPort' => 0,
|
102
|
+
'toPort' => 65535,
|
103
|
+
'ipProtocol' => 'udp',
|
104
|
+
'ipRanges' => []
|
105
|
+
}
|
106
|
+
],
|
107
|
+
'ownerId' => owner_id
|
108
|
+
}
|
109
|
+
},
|
110
|
+
:snapshots => {},
|
111
|
+
:volumes => {}
|
112
|
+
}
|
113
|
+
end
|
112
114
|
end
|
113
115
|
end
|
114
116
|
|
@@ -120,7 +122,8 @@ module Fog
|
|
120
122
|
|
121
123
|
def initialize(options={})
|
122
124
|
@aws_access_key_id = options[:aws_access_key_id]
|
123
|
-
@
|
125
|
+
@region = options[:region] || 'us-east-1'
|
126
|
+
@data = self.class.data[@region][@aws_access_key_id]
|
124
127
|
@owner_id = @data[:owner_id]
|
125
128
|
end
|
126
129
|
|
data/lib/fog/aws/storage.rb
CHANGED
@@ -74,10 +74,12 @@ module Fog
|
|
74
74
|
include Utils
|
75
75
|
|
76
76
|
def self.data
|
77
|
-
@data ||= Hash.new do |hash,
|
78
|
-
hash[
|
79
|
-
|
80
|
-
|
77
|
+
@data ||= Hash.new do |hash, region|
|
78
|
+
hash[region] = Hash.new do |hash, key|
|
79
|
+
hash[key] = {
|
80
|
+
:buckets => {}
|
81
|
+
}
|
82
|
+
end
|
81
83
|
end
|
82
84
|
end
|
83
85
|
|
@@ -89,7 +91,8 @@ module Fog
|
|
89
91
|
|
90
92
|
def initialize(options={})
|
91
93
|
@aws_access_key_id = options[:aws_access_key_id]
|
92
|
-
@
|
94
|
+
@region = options[:region] || 'us-east-1'
|
95
|
+
@data = self.class.data[@region][@aws_access_key_id]
|
93
96
|
end
|
94
97
|
|
95
98
|
def signature(params)
|