vagrant-scaleway 0.2.0 → 0.3.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: 7193eabc56d0f452064f85e342b7b845557d25b7
4
- data.tar.gz: 5250b4df9ae07cc85c570480a715949edd45acab
3
+ metadata.gz: 61f5f7e845b0e2168edf395b77e31b1f41ec36c7
4
+ data.tar.gz: 6313e0795f46e6deedea82f019e58b03b221ea4a
5
5
  SHA512:
6
- metadata.gz: 7d38faaa297dbd510c2ece0380451b9613c2d3cec29b3d7ed258a3843661468c0aa9707d9cf1e34b10718ca923faa8374ea9108ff949af2c4e6b516815a8e7a5
7
- data.tar.gz: 4b6f758fbddbb7da3c3982d4a8637264b241e62ea36f321d2a0ccb1a7c143b5847ac20eb8f88dcab24dd10801abdb19fd52688a27d6f454eb89f69456ee18a77
6
+ metadata.gz: eec720edb8fca36ea608cb2c37cf781d92fa2fc52b2dcdcb457e4ca71db6eedd7a54266524d3b1dc98bdaff56c2e2728e61ddd6496f9c5ace59db2028bb5cc2f
7
+ data.tar.gz: 7ab318e49ba82de3eccb8c5a09a4675785a2eac3b7826c051e3c1408dfdc508f9f2e1af9a4c57a0dd8cb38538302124ac00ce8d9145ad4497777d29407d0222b
data/.rubocop.yml ADDED
@@ -0,0 +1,7 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ DisplayCopNames: true
5
+
6
+ Style/GuardClause:
7
+ Enabled: false
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,20 @@
1
+ Metrics/AbcSize:
2
+ Enabled: false
3
+
4
+ Metrics/CyclomaticComplexity:
5
+ Enabled: false
6
+
7
+ Metrics/LineLength:
8
+ Enabled: false
9
+
10
+ Metrics/MethodLength:
11
+ Enabled: false
12
+
13
+ Metrics/ModuleLength:
14
+ Enabled: false
15
+
16
+ Metrics/PerceivedComplexity:
17
+ Enabled: false
18
+
19
+ Style/Documentation:
20
+ Enabled: false
data/Rakefile CHANGED
@@ -1,9 +1,6 @@
1
1
  require 'bundler/gem_tasks'
2
- require 'rake/testtask'
2
+ require 'rubocop/rake_task'
3
3
 
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << 'test'
6
- t.test_files = FileList['test/**/*_test.rb']
7
- end
4
+ RuboCop::RakeTask.new(:rubocop)
8
5
 
9
- task default: :test
6
+ task default: :rubocop
@@ -1,3 +1,4 @@
1
+ # rubocop:disable Style/FileName
1
2
  require 'pathname'
2
3
  require 'vagrant-scaleway/plugin'
3
4
 
@@ -20,7 +20,8 @@ module VagrantPlugins
20
20
  fog_config = {
21
21
  provider: :scaleway,
22
22
  scaleway_organization: provider_config.organization,
23
- scaleway_token: provider_config.token
23
+ scaleway_token: provider_config.token,
24
+ scaleway_region: provider_config.region
24
25
  }
25
26
 
26
27
  @logger.info('Connecting to Scaleway...')
@@ -9,9 +9,9 @@ module VagrantPlugins
9
9
  def call(env)
10
10
  compute = env[:scaleway_compute]
11
11
 
12
- env[:ui].info('%-37s %-7s %s' % ['Bootscript ID', 'Arch', 'Bootscript Title'], prefix: false)
12
+ env[:ui].info(format('%-37s %-7s %s', 'Bootscript ID', 'Arch', 'Bootscript Title'), prefix: false)
13
13
  compute.bootscripts.sort_by(&:title).each do |bootscript|
14
- env[:ui].info('%-37s %-7s %s' % [bootscript.id, bootscript.architecture, bootscript.title], prefix: false)
14
+ env[:ui].info(format('%-37s %-7s %s', bootscript.id, bootscript.architecture, bootscript.title), prefix: false)
15
15
  end
16
16
 
17
17
  @app.call(env)
@@ -9,11 +9,11 @@ module VagrantPlugins
9
9
  def call(env)
10
10
  compute = env[:scaleway_compute]
11
11
 
12
- env[:ui].info('%-37s %-26s %-7s %-36s %s' % ['Image ID', 'Created At', 'Arch', 'Default Bootscript', 'Image Name'], prefix: false)
12
+ env[:ui].info(format('%-37s %-26s %-7s %-36s %s', 'Image ID', 'Created At', 'Arch', 'Default Bootscript', 'Image Name'), prefix: false)
13
13
  compute.images.sort_by(&:name).each do |image|
14
14
  created_at = Time.parse(image.creation_date)
15
15
  bootscript = image.default_bootscript.title
16
- env[:ui].info('%-37s %-26s %-7s %-36s %s' % [image.id, created_at, image.arch, bootscript, image.name], prefix: false)
16
+ env[:ui].info(format('%-37s %-26s %-7s %-36s %s', image.id, created_at, image.arch, bootscript, image.name), prefix: false)
17
17
  end
18
18
 
19
19
  @app.call(env)
@@ -9,9 +9,9 @@ module VagrantPlugins
9
9
  def call(env)
10
10
  compute = env[:scaleway_compute]
11
11
 
12
- env[:ui].info('%-37s %s' % ['Security Group ID', 'Security Group Name'], prefix: false)
12
+ env[:ui].info(format('%-37s %s', 'Security Group ID', 'Security Group Name'), prefix: false)
13
13
  compute.security_groups.sort_by(&:name).each do |security_group|
14
- env[:ui].info('%-37s %s' % [security_group.id, security_group.name], prefix: false)
14
+ env[:ui].info(format('%-37s %s', security_group.id, security_group.name), prefix: false)
15
15
  end
16
16
 
17
17
  @app.call(env)
@@ -64,12 +64,12 @@ module VagrantPlugins
64
64
  # the time we connect.
65
65
  begin
66
66
  break if env[:machine].communicate.ready?
67
- rescue Exception => e
67
+ rescue
68
68
  if network_ready_retries < network_ready_retries_max
69
69
  network_ready_retries += 1
70
70
  @logger.warn(I18n.t('vagrant_scaleway.waiting_for_ssh, retrying'))
71
71
  else
72
- raise e
72
+ raise
73
73
  end
74
74
  end
75
75
  sleep 2
@@ -3,7 +3,6 @@ module VagrantPlugins
3
3
  module Command
4
4
  class Bootscripts < Vagrant.plugin('2', :command)
5
5
  def execute
6
- options = {}
7
6
  opts = OptionParser.new do |o|
8
7
  o.banner = 'Usage: vagrant scaleway bootscripts [options]'
9
8
  end
@@ -3,7 +3,6 @@ module VagrantPlugins
3
3
  module Command
4
4
  class Images < Vagrant.plugin('2', :command)
5
5
  def execute
6
- options = {}
7
6
  opts = OptionParser.new do |o|
8
7
  o.banner = 'Usage: vagrant scaleway images [options]'
9
8
  end
@@ -43,10 +43,10 @@ module VagrantPlugins
43
43
  end
44
44
 
45
45
  def help
46
- opts = OptionParser.new do |opts|
47
- opts.banner = 'Usage: vagrant scaleway <subcommand> [<args>]'
48
- opts.separator ''
49
- opts.separator 'Available subcommands:'
46
+ opts = OptionParser.new do |o|
47
+ o.banner = 'Usage: vagrant scaleway <subcommand> [<args>]'
48
+ o.separator ''
49
+ o.separator 'Available subcommands:'
50
50
 
51
51
  # Add the available subcommands as separators in order to print them
52
52
  # out as well.
@@ -54,11 +54,11 @@ module VagrantPlugins
54
54
  @subcommands.each { |key, _value| keys << key.to_s }
55
55
 
56
56
  keys.sort.each do |key|
57
- opts.separator " #{key}"
57
+ o.separator " #{key}"
58
58
  end
59
59
 
60
- opts.separator ''
61
- opts.separator 'For help on any individual subcommand run `vagrant scaleway <subcommand> -h`'
60
+ o.separator ''
61
+ o.separator 'For help on any individual subcommand run `vagrant scaleway <subcommand> -h`'
62
62
  end
63
63
 
64
64
  @env.ui.info(opts.help, prefix: false)
@@ -3,7 +3,6 @@ module VagrantPlugins
3
3
  module Command
4
4
  class SecurityGroups < Vagrant.plugin('2', :command)
5
5
  def execute
6
- options = {}
7
6
  opts = OptionParser.new do |o|
8
7
  o.banner = 'Usage: vagrant scaleway security-groups [options]'
9
8
  end
@@ -28,6 +28,12 @@ module VagrantPlugins
28
28
  # @return [String]
29
29
  attr_accessor :organization
30
30
 
31
+ # The name of the Scaleway region to create the server in. It can also be
32
+ # configured with SCW_REGION environment variable. Defaults to par1.
33
+ #
34
+ # @return [String]
35
+ attr_accessor :region
36
+
31
37
  # The security group ID to associate with the server. If nil,
32
38
  # organization's default security group will be used.
33
39
  #
@@ -74,6 +80,7 @@ module VagrantPlugins
74
80
  @image = UNSET_VALUE
75
81
  @name = UNSET_VALUE
76
82
  @organization = UNSET_VALUE
83
+ @region = UNSET_VALUE
77
84
  @server_check_interval = UNSET_VALUE
78
85
  @server_ready_timeout = UNSET_VALUE
79
86
  @security_group = UNSET_VALUE
@@ -93,6 +100,7 @@ module VagrantPlugins
93
100
  end
94
101
 
95
102
  @organization = ENV['SCW_ORGANIZATION'] if @organization == UNSET_VALUE
103
+ @region = (ENV['SCW_REGION'] || 'par1') if @region == UNSET_VALUE
96
104
  @server_check_interval = 2 if @server_check_interval == UNSET_VALUE
97
105
  @server_ready_timeout = 120 if @server_ready_timeout == UNSET_VALUE
98
106
  @security_group = nil if @security_group == UNSET_VALUE
@@ -70,7 +70,6 @@ module VagrantPlugins
70
70
  logger = Log4r::Logger.new('vagrant_scaleway')
71
71
  logger.outputters = Log4r::Outputter.stderr
72
72
  logger.level = level
73
- logger = nil
74
73
  end
75
74
  end
76
75
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Scaleway
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.3.0'.freeze
4
4
  end
5
5
  end
@@ -21,5 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency 'rake'
22
22
  spec.add_development_dependency 'rubocop'
23
23
 
24
- spec.add_dependency 'fog-scaleway', '~> 0.1'
24
+ spec.add_dependency 'fog-scaleway', '~> 0.2'
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-scaleway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.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: 2016-09-25 00:00:00.000000000 Z
11
+ date: 2016-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.1'
61
+ version: '0.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.1'
68
+ version: '0.2'
69
69
  description: Enables Vagrant to manage machines in Scaleway.
70
70
  email:
71
71
  - kaorimatz@gmail.com
@@ -74,6 +74,8 @@ extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
+ - ".rubocop.yml"
78
+ - ".rubocop_todo.yml"
77
79
  - ".ruby-version"
78
80
  - Gemfile
79
81
  - LICENSE.txt