vagrant-openstack-provider 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/Gemfile +1 -1
- data/lib/vagrant-openstack-provider/action/create_stack.rb +8 -0
- data/lib/vagrant-openstack-provider/action/delete_stack.rb +1 -1
- data/lib/vagrant-openstack-provider/action/provision.rb +1 -1
- data/lib/vagrant-openstack-provider/command/flavor_list.rb +1 -1
- data/lib/vagrant-openstack-provider/command/floatingip_list.rb +1 -1
- data/lib/vagrant-openstack-provider/command/image_list.rb +1 -1
- data/lib/vagrant-openstack-provider/command/subnet_list.rb +1 -1
- data/lib/vagrant-openstack-provider/command/utils.rb +1 -1
- data/lib/vagrant-openstack-provider/command/volume_list.rb +1 -1
- data/lib/vagrant-openstack-provider/version.rb +1 -1
- data/locales/en.yml +3 -3
- data/spec/vagrant-openstack-provider/action/provision_spec.rb +4 -11
- data/spec/vagrant-openstack-provider/command/flavor_list_spec.rb +1 -1
- data/spec/vagrant-openstack-provider/command/floatingip_list_spec.rb +1 -1
- data/spec/vagrant-openstack-provider/command/image_list_spec.rb +2 -2
- data/spec/vagrant-openstack-provider/command/network_list_spec.rb +2 -2
- data/spec/vagrant-openstack-provider/command/subnet_list_spec.rb +1 -1
- data/spec/vagrant-openstack-provider/command/volume_list_spec.rb +1 -1
- data/vagrant-openstack-provider.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9022e93970b0f478724dc90c2ca175f58fb01709
|
4
|
+
data.tar.gz: fd7fdb5c1d26754414d7ef0fcf090c4262e8a355
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0f29d5cda71ac448c6bd089aec587a05d0affed2dc2dbcd0df39af8e16e9ba2651a69720907d67047203d3c3e21493a5d06c4e19944a699bb975b2662556d21
|
7
|
+
data.tar.gz: 0347baa297f56ded5ffb9eeffd081808763cb63ec079803ab158616cc867a25036c79392c4a4c929673be1d41ad36e779cccad71529a7d37362c3c9a8201a070
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :development do
|
6
|
-
gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git', tag: 'v1.
|
6
|
+
gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git', tag: 'v1.7.4'
|
7
7
|
gem 'appraisal', '1.0.0'
|
8
8
|
gem 'rubocop', '0.29.0', require: false
|
9
9
|
gem 'coveralls', require: false
|
@@ -13,12 +13,19 @@ module VagrantPlugins
|
|
13
13
|
module Openstack
|
14
14
|
module Action
|
15
15
|
class CreateStack < AbstractAction
|
16
|
+
@@is_created = false
|
17
|
+
|
16
18
|
def initialize(app, _env)
|
17
19
|
@app = app
|
18
20
|
@logger = Log4r::Logger.new('vagrant_openstack::action::create_stack')
|
19
21
|
end
|
20
22
|
|
21
23
|
def execute(env)
|
24
|
+
if @@is_created
|
25
|
+
@app.call(env)
|
26
|
+
return
|
27
|
+
end
|
28
|
+
|
22
29
|
@logger.info 'Start create stacks action'
|
23
30
|
|
24
31
|
config = env[:machine].provider_config
|
@@ -43,6 +50,7 @@ module VagrantPlugins
|
|
43
50
|
waiting_for_stack_to_be_created(env, stack[:name], stack_id)
|
44
51
|
end unless config.stacks.nil?
|
45
52
|
|
53
|
+
@@is_created = true
|
46
54
|
@app.call(env)
|
47
55
|
end
|
48
56
|
|
@@ -26,7 +26,7 @@ module VagrantPlugins
|
|
26
26
|
list_stack_files(env).each do |stack|
|
27
27
|
env[:ui].info(I18n.t('vagrant_openstack.delete_stack'))
|
28
28
|
env[:ui].info(" -- Stack Name : #{stack[:name]}")
|
29
|
-
env[:ui].info(" -- Stack
|
29
|
+
env[:ui].info(" -- Stack ID : #{stack[:id]}")
|
30
30
|
|
31
31
|
heat.delete_stack(env, stack[:name], stack[:id])
|
32
32
|
|
@@ -31,7 +31,7 @@ module VagrantPlugins
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def run_provisioner(env)
|
34
|
-
if env[:provisioner].
|
34
|
+
if env[:provisioner].is_a?(Vagrant.plugin('2').manager.provisioners[:shell])
|
35
35
|
handle_shell_meta_args(env)
|
36
36
|
end
|
37
37
|
env[:provisioner].provision
|
@@ -16,7 +16,7 @@ module VagrantPlugins
|
|
16
16
|
flavors.each do |f|
|
17
17
|
rows << [f.id, f.name, f.vcpus, f.ram, f.disk]
|
18
18
|
end
|
19
|
-
display_table(env, ['
|
19
|
+
display_table(env, ['ID', 'Name', 'vCPU', 'RAM (Mo)', 'Disk size (Go)'], rows)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -24,7 +24,7 @@ module VagrantPlugins
|
|
24
24
|
floating_ips.each do |floating_ip|
|
25
25
|
rows << [floating_ip['id'], floating_ip['ip'], floating_ip['pool'], floating_ip['instance_id']]
|
26
26
|
end
|
27
|
-
display_table(env, ['
|
27
|
+
display_table(env, ['ID', 'IP', 'Pool', 'Instance ID'], rows)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -11,7 +11,7 @@ module VagrantPlugins
|
|
11
11
|
def cmd(name, argv, env)
|
12
12
|
fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 0
|
13
13
|
rows = []
|
14
|
-
headers = %w(
|
14
|
+
headers = %w(ID Name)
|
15
15
|
if env[:openstack_client].session.endpoints.key? :image
|
16
16
|
images = env[:openstack_client].glance.get_all_images(env)
|
17
17
|
images.each { |i| rows << [i.id, i.name, i.visibility, i.size.to_i / 1024 / 1024, i.min_ram, i.min_disk] }
|
@@ -14,7 +14,7 @@ module VagrantPlugins
|
|
14
14
|
env[:openstack_client].neutron.get_subnets(env).each do |subnet|
|
15
15
|
rows << [subnet.id, subnet.name, subnet.cidr, subnet.enable_dhcp, subnet.network_id]
|
16
16
|
end
|
17
|
-
display_table(env, ['
|
17
|
+
display_table(env, ['ID', 'Name', 'CIDR', 'DHCP', 'Network ID'], rows)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -17,7 +17,7 @@ module VagrantPlugins
|
|
17
17
|
attachment = "#{v.instance_id} (#{v.device})" unless v.instance_id.nil?
|
18
18
|
rows << [v.id, v.name, v.size, v.status, attachment]
|
19
19
|
end
|
20
|
-
display_table(env, ['
|
20
|
+
display_table(env, ['ID', 'Name', 'Size (Go)', 'Status', 'Attachment (instance ID and device)'], rows)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
data/locales/en.yml
CHANGED
@@ -23,7 +23,7 @@ en:
|
|
23
23
|
$ vagrant plugin update vagrant-openstack-provider
|
24
24
|
version_unstable: |-
|
25
25
|
You're not running a stable version of the 'vagrant-openstack-provider' plugin.
|
26
|
-
Unless you are either developing on vagrant or have
|
26
|
+
Unless you are either developing on vagrant or have deliberately installed a not
|
27
27
|
stable version, you should uninstall it an install the latest stable version
|
28
28
|
running commands :
|
29
29
|
|
@@ -173,14 +173,14 @@ en:
|
|
173
173
|
sync_method_error: |-
|
174
174
|
Value '%{sync_method_value}' is not allowed for 'sync_method' configuration parameter. Valid values are 'rsync' and 'none'
|
175
175
|
rsync_error: |-
|
176
|
-
There was an error when
|
176
|
+
There was an error when attempting to rsync a share folder.
|
177
177
|
Please inspect the error message below for more info.
|
178
178
|
|
179
179
|
Host path: %{hostpath}
|
180
180
|
Guest path: %{guestpath}
|
181
181
|
Error: %{stderr}
|
182
182
|
ssh_unavailble: |-
|
183
|
-
SSH server
|
183
|
+
SSH server unavailable on instance %{host}. You should maybe increase the timeout value which currently is %{timeout} second(s).
|
184
184
|
no_arg_required_for_command: |-
|
185
185
|
Command '%{cmd}' does not required any argument.
|
186
186
|
unrecognized_arg_for_command: |-
|
@@ -17,17 +17,6 @@ class FakeShellProvisioner < FakeProvisioner
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
#
|
21
|
-
# Monkeypatch the VagrantPlugins::Shell module
|
22
|
-
# to enabled using an FakeShellProvisioner in
|
23
|
-
# place of a the real shell provisioner class
|
24
|
-
#
|
25
|
-
module VagrantPlugins
|
26
|
-
module Shell
|
27
|
-
Provisioner = FakeShellProvisioner
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
20
|
describe VagrantPlugins::Openstack::Action::ProvisionWrapper do
|
32
21
|
let(:app) do
|
33
22
|
double
|
@@ -38,6 +27,8 @@ describe VagrantPlugins::Openstack::Action::ProvisionWrapper do
|
|
38
27
|
end
|
39
28
|
|
40
29
|
before :each do
|
30
|
+
# Stub lookup for provisioners and return a hash containing the test mock.
|
31
|
+
allow(Vagrant.plugin('2').manager).to receive(:provisioners).and_return(shell: FakeShellProvisioner)
|
41
32
|
@action = ProvisionWrapper.new(app, nil)
|
42
33
|
end
|
43
34
|
|
@@ -57,6 +48,8 @@ describe VagrantPlugins::Openstack::Action::InternalProvisionWrapper do
|
|
57
48
|
end
|
58
49
|
|
59
50
|
before :each do
|
51
|
+
# Stub lookup for provisioners and return a hash containing the test mock.
|
52
|
+
allow(Vagrant.plugin('2').manager).to receive(:provisioners).and_return(shell: FakeShellProvisioner)
|
60
53
|
@action = InternalProvisionWrapper.new(nil, env)
|
61
54
|
end
|
62
55
|
|
@@ -31,7 +31,7 @@ describe VagrantPlugins::Openstack::Command::FlavorList do
|
|
31
31
|
|
32
32
|
expect(env[:ui]).to receive(:info).with('
|
33
33
|
+-----+-------+------+----------+----------------+
|
34
|
-
|
|
34
|
+
| ID | Name | vCPU | RAM (Mo) | Disk size (Go) |
|
35
35
|
+-----+-------+------+----------+----------------+
|
36
36
|
| 001 | small | 1 | 1024 | 10 |
|
37
37
|
| 002 | large | 4 | 4096 | 100 |
|
@@ -62,7 +62,7 @@ describe VagrantPlugins::Openstack::Command::FloatingIpList do
|
|
62
62
|
|
63
63
|
expect(env[:ui]).to receive(:info).with('
|
64
64
|
+----+------------+-------+-------------+
|
65
|
-
|
|
65
|
+
| ID | IP | Pool | Instance ID |
|
66
66
|
+----+------------+-------+-------------+
|
67
67
|
| 1 | 10.10.10.1 | pool1 | |
|
68
68
|
| 2 | 10.10.10.2 | pool2 | inst001 |
|
@@ -54,7 +54,7 @@ describe VagrantPlugins::Openstack::Command::ImageList do
|
|
54
54
|
|
55
55
|
expect(env[:ui]).to receive(:info).with('
|
56
56
|
+------+--------+
|
57
|
-
|
|
57
|
+
| ID | Name |
|
58
58
|
+------+--------+
|
59
59
|
| 0001 | ubuntu |
|
60
60
|
| 0002 | centos |
|
@@ -82,7 +82,7 @@ describe VagrantPlugins::Openstack::Command::ImageList do
|
|
82
82
|
|
83
83
|
expect(env[:ui]).to receive(:info).with('
|
84
84
|
+------+--------+------------+-----------+--------------+---------------+
|
85
|
-
|
|
85
|
+
| ID | Name | Visibility | Size (Mo) | Min RAM (Go) | Min Disk (Go) |
|
86
86
|
+------+--------+------------+-----------+--------------+---------------+
|
87
87
|
| 0001 | ubuntu | public | 700 | 1 | 10 |
|
88
88
|
| 0002 | centos | private | 800 | 2 | 20 |
|
@@ -38,7 +38,7 @@ describe VagrantPlugins::Openstack::Command::NetworkList do
|
|
38
38
|
|
39
39
|
expect(env[:ui]).to receive(:info).with('
|
40
40
|
+--------+----------+
|
41
|
-
|
|
41
|
+
| ID | Name |
|
42
42
|
+--------+----------+
|
43
43
|
| net-01 | internal |
|
44
44
|
| net-02 | external |
|
@@ -52,7 +52,7 @@ describe VagrantPlugins::Openstack::Command::NetworkList do
|
|
52
52
|
|
53
53
|
expect(env[:ui]).to receive(:info).with('
|
54
54
|
+--------+----------+
|
55
|
-
|
|
55
|
+
| ID | Name |
|
56
56
|
+--------+----------+
|
57
57
|
| pub-01 | public |
|
58
58
|
| net-01 | internal |
|
@@ -32,7 +32,7 @@ describe VagrantPlugins::Openstack::Command::SubnetList do
|
|
32
32
|
|
33
33
|
expect(env[:ui]).to receive(:info).with('
|
34
34
|
+-----------+----------+------------------+-------+------------+
|
35
|
-
|
|
35
|
+
| ID | Name | CIDR | DHCP | Network ID |
|
36
36
|
+-----------+----------+------------------+-------+------------+
|
37
37
|
| subnet-01 | Subnet 1 | 192.168.1.0/24 | true | net-01 |
|
38
38
|
| subnet-02 | Subnet 2 | 192.168.2.0/24 | false | net-01 |
|
@@ -28,7 +28,7 @@ describe VagrantPlugins::Openstack::Command::VolumeList do
|
|
28
28
|
cinder.should_receive(:get_all_volumes).with(env)
|
29
29
|
expect(env[:ui]).to receive(:info).with('
|
30
30
|
+-----+--------+-----------+-----------+-------------------------------------+
|
31
|
-
|
|
31
|
+
| ID | Name | Size (Go) | Status | Attachment (instance ID and device) |
|
32
32
|
+-----+--------+-----------+-----------+-------------------------------------+
|
33
33
|
| 987 | vol-01 | 2 | available | |
|
34
34
|
| 654 | vol-02 | 4 | in-use | inst-01 (/dev/vdc) |
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.homepage = 'https://github.com/ggiamarchi/vagrant-openstack-provider'
|
13
13
|
gem.license = 'MIT'
|
14
14
|
|
15
|
-
gem.add_dependency 'json', '1.
|
15
|
+
gem.add_dependency 'json', '1.8.3'
|
16
16
|
gem.add_dependency 'rest-client', '~> 1.6.0'
|
17
17
|
gem.add_dependency 'terminal-table', '1.4.5'
|
18
18
|
gem.add_dependency 'sshkey', '1.6.1'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-openstack-provider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Giamarchi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.
|
20
|
+
version: 1.8.3
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 1.
|
27
|
+
version: 1.8.3
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rest-client
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|