vagrant-scaleway 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -0
- data/.rubocop_todo.yml +20 -0
- data/Rakefile +3 -6
- data/lib/vagrant-scaleway.rb +1 -0
- data/lib/vagrant-scaleway/action/connect_scaleway.rb +2 -1
- data/lib/vagrant-scaleway/action/list_bootscripts.rb +2 -2
- data/lib/vagrant-scaleway/action/list_images.rb +2 -2
- data/lib/vagrant-scaleway/action/list_security_groups.rb +2 -2
- data/lib/vagrant-scaleway/action/start_server.rb +2 -2
- data/lib/vagrant-scaleway/command/bootscripts.rb +0 -1
- data/lib/vagrant-scaleway/command/images.rb +0 -1
- data/lib/vagrant-scaleway/command/root.rb +7 -7
- data/lib/vagrant-scaleway/command/security_groups.rb +0 -1
- data/lib/vagrant-scaleway/config.rb +8 -0
- data/lib/vagrant-scaleway/plugin.rb +0 -1
- data/lib/vagrant-scaleway/version.rb +1 -1
- data/vagrant-scaleway.gemspec +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61f5f7e845b0e2168edf395b77e31b1f41ec36c7
|
4
|
+
data.tar.gz: 6313e0795f46e6deedea82f019e58b03b221ea4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eec720edb8fca36ea608cb2c37cf781d92fa2fc52b2dcdcb457e4ca71db6eedd7a54266524d3b1dc98bdaff56c2e2728e61ddd6496f9c5ace59db2028bb5cc2f
|
7
|
+
data.tar.gz: 7ab318e49ba82de3eccb8c5a09a4675785a2eac3b7826c051e3c1408dfdc508f9f2e1af9a4c57a0dd8cb38538302124ac00ce8d9145ad4497777d29407d0222b
|
data/.rubocop.yml
ADDED
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 '
|
2
|
+
require 'rubocop/rake_task'
|
3
3
|
|
4
|
-
|
5
|
-
t.libs << 'test'
|
6
|
-
t.test_files = FileList['test/**/*_test.rb']
|
7
|
-
end
|
4
|
+
RuboCop::RakeTask.new(:rubocop)
|
8
5
|
|
9
|
-
task default: :
|
6
|
+
task default: :rubocop
|
data/lib/vagrant-scaleway.rb
CHANGED
@@ -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'
|
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'
|
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'
|
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'
|
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'
|
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'
|
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
|
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
|
72
|
+
raise
|
73
73
|
end
|
74
74
|
end
|
75
75
|
sleep 2
|
@@ -43,10 +43,10 @@ module VagrantPlugins
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def help
|
46
|
-
opts = OptionParser.new do |
|
47
|
-
|
48
|
-
|
49
|
-
|
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
|
-
|
57
|
+
o.separator " #{key}"
|
58
58
|
end
|
59
59
|
|
60
|
-
|
61
|
-
|
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)
|
@@ -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
|
data/vagrant-scaleway.gemspec
CHANGED
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.
|
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-
|
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.
|
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.
|
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
|