fog-softlayer 0.3.26 → 0.3.27

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjcxZjFjMjViMTg3ODUwYjNiYTkwZTdlZmNhNWY2MTFiZTNjZWM0ZA==
4
+ YWZjZmRmZWUzNTVjZDhiMGFjZjE3ZDFmZDhjOTdkNDllYjk1ZDY5MQ==
5
5
  data.tar.gz: !binary |-
6
- YmJjYjQ4OTdlYmExMTI4NmE0ODcyZTcwMjE3ZDI4MzBlNjJiNTM5NA==
6
+ ZjAzYmQ5NTI0MmMzYjM1N2Y1ZmZiNmFlZDYyODQ2NTg2NmI3ZTRkOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTE5MDZmOWY2NDRiYWQ3OWNmOGQzZGIwZmI3ZjFmNWY3YzE4OTk1MDdiNzMw
10
- Y2NlMmQ0MWJiODM0ZWM5NzA1ODUzMjExZTc0YzM3YzQzZmZkNzZmYzAyOWEz
11
- YmI2ZGFiYWNhYWRkMTAxMWJlOTQxZTI1Yzk1MzljMzY4MDQwZWY=
9
+ OWI5YjU2YjdkYjI0MWM2MmRkYTE5MzMyMDhiYTBjMjU5ZjY4OWQzM2EyOWU2
10
+ NDAzNzBjM2JjMjFiMDA2Yjc5YzU0OWQ2N2QwYTNmY2E2N2E4OTkzN2VjZTQ3
11
+ MGM5MjkwN2JiYTAyYWE2ZDZiODNiYjM2Njg0M2NkYjcyYmYwYWU=
12
12
  data.tar.gz: !binary |-
13
- NDNhZTU0ZGNjYzc0NTAwYjY5NWFhMjgwYTdlNjkzMDgxZDY2NzNkYTZlYjc4
14
- NjNhOTEwYjVmNmQxMjBkMjFmMTYxMzcyY2UwZDUwODRmOTIxZTU4ZGE2Yjg0
15
- NmIyYWUwNDdiNzM1MWYxMWNjZmM1ZGZkZGU1OGVlOWIwYjU3MjQ=
13
+ YTA2MWY4MTQ4NWNmMzgyM2I0YjVhY2IxNTcwZDI1NjNkNGM1YTJkMjFjYjFj
14
+ MjhkNjQ5ZWQyMDdjZTA3OTZjODUzMjRmN2U1ZDk0YTYxODkzNGUxZDhkMTFj
15
+ NDE0YzNiMWU1N2VmMjM3NWM4YTk3MmNlMGFmMWZhZTY0MDk3NzQ=
@@ -162,7 +162,7 @@ module Fog
162
162
  unless value.is_a?(Integer) or value.is_a?(Fog::Network::Softlayer::Network)
163
163
  raise ArgumentError, "vlan argument for #{self.class.name}##{__method__} must be Integer or Fog::Network::Softlayer::Network."
164
164
  end
165
- value = Fog::Network[:softlayer].networks.get(value) if value.is_a?(Integer)
165
+ value = network_connection.networks.get(value) if value.is_a?(Integer)
166
166
  attributes[:private_vlan] = value
167
167
  end
168
168
 
@@ -202,7 +202,7 @@ module Fog
202
202
  unless value.is_a?(Integer) or value.is_a?(Fog::Network::Softlayer::Network)
203
203
  raise ArgumentError, "vlan argument for #{self.class.name}##{__method__} must be Integer or Fog::Network::Softlayer::Network."
204
204
  end
205
- value = Fog::Network[:softlayer].networks.get(value) if value.is_a?(Integer)
205
+ value = network_connection.networks.get(value) if value.is_a?(Integer)
206
206
  attributes[:vlan] = value
207
207
  end
208
208
 
@@ -327,6 +327,14 @@ module Fog
327
327
 
328
328
  private
329
329
 
330
+ def network_connection
331
+ @network_conn ||= Fog::Network.new(
332
+ :provider => :softlayer,
333
+ :softlayer_username => service.instance_variable_get(:@softlayer_username),
334
+ :softlayer_api_key => service.instance_variable_get(:@softlayer_api_key)
335
+ )
336
+ end
337
+
330
338
  def _get_private_vlan
331
339
  if self.id
332
340
  vlan_id = if bare_metal?
@@ -334,7 +342,7 @@ module Fog
334
342
  else
335
343
  service.request(:virtual_guest, self.id, :query => 'objectMask=primaryBackendNetworkComponent.networkVlan').body['primaryBackendNetworkComponent']['networkVlan']['id']
336
344
  end
337
- Fog::Network[:softlayer].networks.get(vlan_id)
345
+ network_connection.networks.get(vlan_id)
338
346
  end
339
347
  end
340
348
 
@@ -345,7 +353,7 @@ module Fog
345
353
  else
346
354
  service.request(:virtual_guest, self.id, :query => 'objectMask=primaryNetworkComponent.networkVlan').body['primaryNetworkComponent']['networkVlan']['id']
347
355
  end
348
- Fog::Network[:softlayer].networks.get(vlan_id)
356
+ network_connection.networks.get(vlan_id)
349
357
  end
350
358
  end
351
359
 
@@ -7,6 +7,6 @@
7
7
 
8
8
  module Fog
9
9
  module Softlayer
10
- VERSION = "0.3.26"
10
+ VERSION = "0.3.27"
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-softlayer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.26
4
+ version: 0.3.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Eldridge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-19 00:00:00.000000000 Z
11
+ date: 2015-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core