fog-ecloud 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e83dda125c24efdc6bb59f7a1efa4ff4120a696
4
- data.tar.gz: 1f12561d6840d912487e3b232427ce0bbae71d03
3
+ metadata.gz: 0ec8e33430c2f7d0e58e5f35e129e0299c535e71
4
+ data.tar.gz: 04fe961db178cc2ea233cc763e2e04fdfc7ab866
5
5
  SHA512:
6
- metadata.gz: acaf1a53a378f337dffbd099a5d39df257d5e5d80f4471d8bdb685b4edfc7afc02802512cb2f02b49792d36ec24baa64b8b5e5adeffff8980686792aef3cf8bf
7
- data.tar.gz: d9850ff7f927e0c00d6b139418626db6d2979acf6c2492c5ae3065f95e3894d479417b5bd408ae8ccdbc1abe38beffcc3d94996f15ce442dd41eb47e8b4f9dca
6
+ metadata.gz: 9c960b0135d9e5a89fb2bbe8217ff72f21e9017f9c6f0ce28c83a13febbbae67eaca6d1ae12398e0aebdc99256ecb6ff05a9a2729f9394815311f428e204441b
7
+ data.tar.gz: 7f35e38111a6b82c25e5c950f91ddfb42b4dff4b59d63612262e440f457e2e88b120d69aeea534bdd5d4cd02cc545aabfcd81ab6496390bfc0827b7caef211bc
@@ -289,8 +289,8 @@ module Fog
289
289
  @persistent = options[:persistent] || false
290
290
  @version = options[:ecloud_version] || "2013-06-01"
291
291
  @authentication_method = options[:ecloud_authentication_method] || :cloud_api_auth
292
- @access_key = options[:ecloud_access_key]
293
- @private_key = options[:ecloud_private_key]
292
+ @access_key = options[:ecloud_access_key].to_s
293
+ @private_key = options[:ecloud_private_key].to_s
294
294
  if @private_key.nil? || @authentication_method == :basic_auth
295
295
  @authentication_method = :basic_auth
296
296
  @username = options[:ecloud_username]
@@ -308,7 +308,7 @@ module Fog
308
308
  if params[:uri].is_a?(String)
309
309
  params[:uri] = URI.parse(@host + params[:uri])
310
310
  end
311
- host_url = "#{params[:uri].scheme}://#{params[:uri].host}#{params[:uri].port ? ':#{params[:uri].port}' : ''}"
311
+ host_url = "#{params[:uri].scheme}://#{params[:uri].host}#{params[:uri].port ? ":#{params[:uri].port}" : ''}"
312
312
 
313
313
  # Hash connections on the host_url ... There"s nothing to say we won"t get URI"s that go to
314
314
  # different hosts.
@@ -401,7 +401,7 @@ module Fog
401
401
  # section 5.6.3.3 in the ~1000 page pdf spec
402
402
  def canonicalize_resource(path)
403
403
  uri, query_string = path.split("?")
404
- return uri if query_string.nil?
404
+ return uri.downcase if query_string.nil?
405
405
  query_string_pairs = query_string.split("&").sort.map { |e| e.split("=") }
406
406
  tm_query_string = query_string_pairs.map { |x| "#{x.first.downcase}:#{x.last}" }.join("\n")
407
407
  "#{uri.downcase}\n#{tm_query_string}\n"
@@ -37,6 +37,11 @@ module Fog
37
37
  self.service.organizations.new(organization_link)
38
38
  end
39
39
  end
40
+
41
+ def reload
42
+ @organization = nil
43
+ super
44
+ end
40
45
  end
41
46
  end
42
47
  end
@@ -64,6 +64,19 @@ module Fog
64
64
  def id
65
65
  href.scan(/\d+/)[0]
66
66
  end
67
+
68
+ def reload
69
+ @servers = nil
70
+ @layout = nil
71
+ @cpu_usage = nil
72
+ @memory_usage = nil
73
+ @storage_usage = nil
74
+ @operating_system_families = nil
75
+ @templates = nil
76
+ @detached_disks = nil
77
+ @environment = nil
78
+ super
79
+ end
67
80
  end
68
81
  end
69
82
  end
@@ -104,6 +104,24 @@ module Fog
104
104
  self.service.organizations.new(organization_link)
105
105
  end
106
106
  end
107
+
108
+ def reload
109
+ @public_ips = nil
110
+ @internet_services = nil
111
+ @node_services = nil
112
+ @backup_internet_services = nil
113
+ @networks = nil
114
+ @layout = nil
115
+ @rows = nil
116
+ @tasks = nil
117
+ @firewall_acls = nil
118
+ @compute_pools = nil
119
+ @physical_devices = nil
120
+ @trusted_network_groups = nil
121
+ @rnats = nil
122
+ @organization = nil
123
+ super
124
+ end
107
125
  end
108
126
  Vdc = Environment
109
127
  end
@@ -12,8 +12,18 @@ module Fog
12
12
 
13
13
  def all
14
14
  data = []
15
- service.get_organization(href).body[:Locations][:Location].each do |d|
16
- environments = d[:Environments]
15
+ raw_location = service.get_organization(href).body[:Locations][:Location]
16
+ if raw_location.is_a?(Array)
17
+ # If there's more than one location, the XML parser returns an
18
+ # array.
19
+ location = raw_location
20
+ else
21
+ # Otherwise it returns a hash.
22
+ location = [raw_location]
23
+ end
24
+
25
+ location.each do |l|
26
+ environments = l[:Environments]
17
27
  next unless environments
18
28
  if environments[:Environment].is_a?(Array)
19
29
  environments[:Environment].each { |e| data << e }
@@ -91,6 +91,12 @@ module Fog
91
91
  end
92
92
 
93
93
  alias_method :destroy, :delete
94
+
95
+ def reload
96
+ @nodes = nil
97
+ @monitors = nil
98
+ super
99
+ end
94
100
  end
95
101
  end
96
102
  end
@@ -33,6 +33,11 @@ module Fog
33
33
  network_href = other_links.find { |l| l[:type] == "application/vnd.tmrk.cloud.network" }[:href]
34
34
  network = self.service.networks.get(network_href)
35
35
  end
36
+
37
+ def reload
38
+ @server = nil
39
+ super
40
+ end
36
41
  end
37
42
  end
38
43
  end
@@ -14,6 +14,11 @@ module Fog
14
14
  def id
15
15
  href.scan(/\d+/)[0]
16
16
  end
17
+
18
+ def reload
19
+ @rows = nil
20
+ super
21
+ end
17
22
  end
18
23
  end
19
24
  end
@@ -16,6 +16,11 @@ module Fog
16
16
  def id
17
17
  href.scan(/\d+/)[0]
18
18
  end
19
+
20
+ def reload
21
+ @catalog = nil
22
+ super
23
+ end
19
24
  end
20
25
  end
21
26
  end
@@ -40,6 +40,12 @@ module Fog
40
40
  def location
41
41
  environment.id
42
42
  end
43
+
44
+ def reload
45
+ @rnats = nil
46
+ @ips = nil
47
+ super
48
+ end
43
49
  end
44
50
  end
45
51
  end
@@ -39,6 +39,11 @@ module Fog
39
39
  end
40
40
 
41
41
  alias_method :destroy, :delete
42
+
43
+ def reload
44
+ @tasks = nil
45
+ super
46
+ end
42
47
  end
43
48
  end
44
49
  end
@@ -15,6 +15,11 @@ module Fog
15
15
  def id
16
16
  href.scan(/\d+/)[0]
17
17
  end
18
+
19
+ def reload
20
+ @operating_systems = nil
21
+ super
22
+ end
18
23
  end
19
24
  end
20
25
  end
@@ -39,6 +39,19 @@ module Fog
39
39
  end
40
40
  end
41
41
 
42
+ # Set instance variables for child collections/models to nil so that they will be reloaded correctly
43
+ #
44
+ # @return nothing
45
+ def reload
46
+ @locations = nil
47
+ @environments = nil
48
+ @tags = nil
49
+ @admin = nil
50
+ @users = nil
51
+ @support_tickets = nil
52
+ super
53
+ end
54
+
42
55
  def edit_authentication_levels(options = {})
43
56
  options[:uri] = "#{service.base_path}/admin/organizations/#{id}/authenticationLevels"
44
57
  data = service.admin_edit_authentication_levels(options).body
@@ -32,6 +32,11 @@ module Fog
32
32
  def organization_uri=(new_organization_uri)
33
33
  @organization_uri = new_organization_uri
34
34
  end
35
+
36
+ def reload
37
+ @organization_uri = nil
38
+ super
39
+ end
35
40
  end
36
41
  end
37
42
  end
@@ -317,6 +317,15 @@ module Fog
317
317
  end
318
318
 
319
319
  alias_method :destroy, :delete
320
+
321
+ def reload
322
+ @tasks = nil
323
+ @processes = nil
324
+ @hardware_configuration = nil
325
+ @configuration = nil
326
+ @networks = nil
327
+ super
328
+ end
320
329
  end
321
330
  end
322
331
  end
@@ -27,6 +27,11 @@ module Fog
27
27
  def id
28
28
  href.scan(/\d+/)[0]
29
29
  end
30
+
31
+ def reload
32
+ @internet_services = nil
33
+ super
34
+ end
30
35
  end
31
36
  end
32
37
  end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Ecloud
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-ecloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Henrique Lopes Ribeiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-06 00:00:00.000000000 Z
11
+ date: 2015-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core