fog-scaleway 0.3.0 → 0.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db12bf5472f63d0a82967f353364b030d692aa52
4
- data.tar.gz: 0b9b420db0de3ae446a3a8b849de10cc06ed7bec
3
+ metadata.gz: b1d7d2673388f2dc8e5bfbb0473221e75c85faf0
4
+ data.tar.gz: 6bcd387f1f0831c3b637f062c4b2d370f4e9e24f
5
5
  SHA512:
6
- metadata.gz: c7c53503be5dbea85781e6d2a4ac210fb7e95c533c0fa1a721736cc38e0ac9e5b5c9224bed40d5b9c4f8a288c1a5fad7be2d46e70f0a975e07555c6871db913e
7
- data.tar.gz: 548432aeeaa06b08871bade39ba2561a47f4c17b09ec6d298ae51405b42d62e45ec498d4db3d0bc72ab90e58ac7829f1b028b2fc42de07e22509009b02fdd1aa
6
+ metadata.gz: f61d0c7c3aeb85e2af10b5b6673fd87cfbd940c293f382db1e6e174a68b897a0746de80941674a9c46689cbe71c0345c892639b798f53bebe7b39826cc7d2d7b
7
+ data.tar.gz: 822310176f0921c1bc1eb46aced26550c28ef36efd6fe189c8c13e11cfea95b24e8448b5c825d951de51c381e0d3542a2c513a4b8dc9aecc1b47d9170438bef0
data/fog-scaleway.gemspec CHANGED
@@ -1,5 +1,3 @@
1
- # coding: utf-8
2
-
3
1
  lib = File.expand_path('../lib', __FILE__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
  require 'fog/scaleway/version'
@@ -47,8 +47,9 @@ module Fog
47
47
  include Fog::Scaleway::RequestHelper
48
48
 
49
49
  def initialize(options)
50
- @token = options[:scaleway_token]
51
- @email = options[:scaleway_email]
50
+ @token = options[:scaleway_token]
51
+ @email = options[:scaleway_email]
52
+ @connection_options = options[:connection_options] || {}
52
53
  end
53
54
 
54
55
  def request(params)
@@ -73,7 +74,7 @@ module Fog
73
74
  private
74
75
 
75
76
  def client
76
- @client ||= Fog::Scaleway::Client.new('https://account.scaleway.com', @token)
77
+ @client ||= Fog::Scaleway::Client.new('https://account.scaleway.com', @token, @connection_options)
77
78
  end
78
79
 
79
80
  def camelize(str)
@@ -1,9 +1,10 @@
1
1
  module Fog
2
2
  module Scaleway
3
3
  class Client
4
- def initialize(endpoint, token)
5
- @endpoint = endpoint
6
- @token = token
4
+ def initialize(endpoint, token, connection_options)
5
+ @endpoint = endpoint
6
+ @token = token
7
+ @connection_options = connection_options
7
8
  end
8
9
 
9
10
  def request(params)
@@ -23,7 +24,7 @@ module Fog
23
24
  private
24
25
 
25
26
  def connection
26
- @connection ||= Fog::Core::Connection.new(@endpoint)
27
+ @connection ||= Fog::Core::Connection.new(@endpoint, false, @connection_options)
27
28
  end
28
29
 
29
30
  def encode_body(params)
@@ -118,9 +118,10 @@ module Fog
118
118
  include Fog::Scaleway::RequestHelper
119
119
 
120
120
  def initialize(options)
121
- @token = options[:scaleway_token]
122
- @organization = options[:scaleway_organization]
123
- @region = options[:scaleway_region] || 'par1'
121
+ @token = options[:scaleway_token]
122
+ @organization = options[:scaleway_organization]
123
+ @region = options[:scaleway_region] || 'par1'
124
+ @connection_options = options[:connection_options] || {}
124
125
  end
125
126
 
126
127
  def request(params)
@@ -145,7 +146,7 @@ module Fog
145
146
  private
146
147
 
147
148
  def client
148
- @client ||= Fog::Scaleway::Client.new(endpoint, @token)
149
+ @client ||= Fog::Scaleway::Client.new(endpoint, @token, @connection_options)
149
150
  end
150
151
 
151
152
  def endpoint
@@ -335,7 +336,7 @@ module Fog
335
336
  security_group = lookup(:security_groups, server['security_group']['id'])
336
337
  security_group['servers'].reject! { |s| s['id'] == server['id'] }
337
338
 
338
- server['volumes'].values.each do |volume|
339
+ server['volumes'].each_value do |volume|
339
340
  volume['server'] = nil
340
341
  delete_volume(volume['id'])
341
342
  end
@@ -28,7 +28,6 @@ module Fog
28
28
  defaults = {
29
29
  name: name,
30
30
  image: '75c28f52-6c64-40fc-bb31-f53ca9d02de9',
31
- commercial_type: 'C2S',
32
31
  dynamic_ip_required: false,
33
32
  public_ip: public_ip
34
33
  }
@@ -127,7 +127,7 @@ module Fog
127
127
 
128
128
  data[:volumes][server['volumes']['0']['id']] = server['volumes']['0']
129
129
 
130
- server['volumes'].each do |_index, volume|
130
+ server['volumes'].each_value do |volume|
131
131
  volume['server'] = {
132
132
  'id' => server['id'],
133
133
  'name' => server['name']
@@ -13,7 +13,7 @@ module Fog
13
13
 
14
14
  data[:images].delete(image['id'])
15
15
 
16
- data[:servers].each do |_id, server|
16
+ data[:servers].each_value do |server|
17
17
  if server['image'] && server['image']['id'] == image['id']
18
18
  server['image'] = nil
19
19
  end
@@ -17,7 +17,7 @@ module Fog
17
17
 
18
18
  data[:volumes].delete(volume_id)
19
19
 
20
- data[:snapshots].each do |_id, snapshot|
20
+ data[:snapshots].each_value do |snapshot|
21
21
  if snapshot['base_volume'] && snapshot['base_volume']['id'] == volume_id
22
22
  snapshot['base_volume'] = nil
23
23
  end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Scaleway
3
- VERSION = '0.3.0'.freeze
3
+ VERSION = '0.4.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-scaleway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Matsumoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-15 00:00:00.000000000 Z
11
+ date: 2018-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler