vagrant-openstack-plugin 0.10.0 → 0.11.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: f101fc3c74f7fb1e3d33a8ef15a48d0089f0d08e
4
- data.tar.gz: 46372f4bb20d168e3cec85ef3dfdcc437ba46344
3
+ metadata.gz: 6715c22f8c8ed79285aac9b2c9b0ea4183518686
4
+ data.tar.gz: 438166569c8bd01f0bacb6f461615982589f8dd7
5
5
  SHA512:
6
- metadata.gz: d27c4cad80f1270a5d52a6c558d63e8406fb24d62e2dfddda0790a5576253e88fce41987be155d4f935e8f8b98de1d2f642cddce3c04d78a7763a515cdd504d8
7
- data.tar.gz: f14c372717634e8d09ba1ccc6c9e1ca3d3468577b4004960a7890eb7482b76235d97d93729563e18f38b53b2ed94e5051adac36c759c592b0d86c3a6c95c11d7
6
+ metadata.gz: d53204d935f19cd2235f8e9685b91bcba58913f525a1aac21192fd3de1e124ee03dfe99d38124957ba3aeceb1fe4e02ca6a31962944d29b57a445e4ab68371d3
7
+ data.tar.gz: 5a64045bcdc12873cc02abcbd23e5016b105466f6609d5a16f67cfc0b579166458b12f89a0aacb7e214d931718da66ca0beded54cb338c119ab41f9008fedbcc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog for vagrant-openstack-plugin
2
2
 
3
+ ## 0.11.0
4
+
5
+ - Merge pull request #97 from cbaenziger/issue_96_fix [view commit](http://github.com///commit/36295904ffb65d7461870a97e561c470fdedbbe5)
6
+ - Merge pull request #95 from cbaenziger/volume_support [view commit](http://github.com///commit/3d3fb8d6ae3b3115abea725820ac4a205c814070)
7
+ - Retry server deletes until we are sure the VM is dead -- only then remove IP's and volumes [view commit](http://github.com///commit/8799e70521a4ad4c4d1a5aa2a3ea42b83c042c38)
8
+ - Update README for more volume related material [view commit](http://github.com///commit/c0e6e0afae67a1e63095f917d50b7c3aa3655547)
9
+ - Fix to prevent stack trace failing to find VM, if destroying a non-existant VM [view commit](http://github.com///commit/7632b70a9f2c5af3a6d46a31b2ce4beb1bc9217b)
10
+ - Use same check as connect.rb for Vagrantfile disks section [view commit](http://github.com///commit/bd440fbacd7abc7914629431edd74e73cad71f95)
11
+ - Fix issue finding volumes if running vagrant destroy after server is destroyed [view commit](http://github.com///commit/8629390d724cdaa611504121bca64690e191cdba)
12
+
3
13
  ## 0.10.0
4
14
 
5
15
  - Merge pull request #84 from cbaenziger/volume_support [view commit](http://github.com///commit/fc613a49cb5b2fecf2255d3050d1bff68956735d)
data/README.md CHANGED
@@ -15,6 +15,7 @@ This plugin started as a fork of the Vagrant RackSpace provider.
15
15
  * SSH into the instances.
16
16
  * Provision the instances with any built-in Vagrant provisioner.
17
17
  * Minimal synced folder support via `rsync`.
18
+ * Creation and destruction of volumes with VM
18
19
 
19
20
  ## Usage
20
21
 
@@ -80,8 +81,8 @@ Vagrant.configure("2") do |config|
80
81
  os.floating_ip_pool = "public" # optional (The floating IP pool to allocate addresses from, if floating_ip = :auto)
81
82
 
82
83
  os.disks = [ # optional
83
- {"name" => "volume_name_here", "description" => "First 10GB Volume", "size" => 10},
84
- {"name" => "volume_name_here", "description" => "Second 10GB Volume", "size" => 10}
84
+ {"name" => "volume_name_here", "description" => "A 10GB Volume", "size" => 10},
85
+ {"name" => "volume_name_here", "description" => "A 20GB Volume", "size" => 20}
85
86
  ]
86
87
 
87
88
  os.orchestration_stack_name = 'stack01' # optional
@@ -167,6 +168,7 @@ This provider exposes quite a few provider-specific configuration options:
167
168
  * `orchestration_cfn_template_parameters` - AWS CloudFormation Template
168
169
  parameters specified in ruby hash (take a look at example Vagrantfile).
169
170
  This parameter is optional.
171
+ * `disks` - Array of disk specifications to create or attach
170
172
 
171
173
  These can be set like typical provider-specific configuration:
172
174
 
@@ -225,6 +227,7 @@ Take snapshot of ***vmname*** with name ***snapshotname***
225
227
  - [Lull3rSkat3r](https://github.com/Lull3rSkat3r)
226
228
  - [nicobrevin](https://github.com/nicobrevin)
227
229
  - [ohnoimdead](https://github.com/ohnoimdead)
230
+ - [cbaenziger](https://github.com/cbaenziger)
228
231
 
229
232
  ## Development
230
233
 
@@ -143,7 +143,7 @@ module VagrantPlugins
143
143
 
144
144
  # Process disks if provided
145
145
  volumes = Array.new
146
- if config.has_key?("disks") and not config.disks.empty?
146
+ if config.disks && !config.disks.empty?
147
147
  env[:ui].info(I18n.t("vagrant_openstack.creating_disks"))
148
148
  config.disks.each do |disk|
149
149
  volume = env[:openstack_compute].volumes.all.find{|v| v.name ==
@@ -1,3 +1,6 @@
1
+ require 'vagrant/util/retryable'
2
+ require 'timeout'
3
+
1
4
  require "log4r"
2
5
 
3
6
  module VagrantPlugins
@@ -5,6 +8,8 @@ module VagrantPlugins
5
8
  module Action
6
9
  # This deletes the running server, if there is one.
7
10
  class DeleteServer
11
+ include Vagrant::Util::Retryable
12
+
8
13
  def initialize(app, env)
9
14
  @app = app
10
15
  @logger = Log4r::Logger.new("vagrant_openstack::action::delete_server")
@@ -12,18 +17,41 @@ module VagrantPlugins
12
17
 
13
18
  def call(env)
14
19
  machine = env[:machine]
15
- id = machine.id || env[:openstack_compute].servers.all( :name => machine.name ).first.id
20
+ id = machine.id || (env[:openstack_compute].servers.all( :name => machine.name ).length == 1 and
21
+ env[:openstack_compute].servers.all( :name => machine.name ).first.id)
16
22
 
17
23
  if id
18
- volumes = env[:openstack_compute].servers.get(id).volume_attachments
19
-
20
24
  env[:ui].info(I18n.t("vagrant_openstack.deleting_server"))
21
25
 
22
26
  # TODO: Validate the fact that we get a server back from the API.
23
27
  server = env[:openstack_compute].servers.get(id)
24
28
  if server
29
+ # get volumes before destroying server
30
+ volumes = server.volume_attachments
31
+
25
32
  ip = server.floating_ip_address
26
- server.destroy
33
+
34
+ retryable(:on => Timeout::Error, :tries => 20) do
35
+ # If we're interrupted don't worry about waiting
36
+ next if env[:interrupted]
37
+
38
+ begin
39
+ server.destroy if server
40
+ status = Timeout::timeout(10) {
41
+ while server.reload
42
+ sleep(1)
43
+ end
44
+ }
45
+ rescue RuntimeError => e
46
+ # If we don't have an error about a state transition, then
47
+ # we just move on.
48
+ raise if e.message !~ /should have transitioned/
49
+ raise Errors::ServerNotDestroyed
50
+ rescue Fog::Compute::OpenStack::NotFound
51
+ # If we don't have a server anymore we should be done here just continue on
52
+ end
53
+ end
54
+
27
55
  if machine.provider_config.floating_ip_pool
28
56
  address = env[:openstack_compute].list_all_addresses.body["floating_ips"].find{|i| i["ip"] == ip}
29
57
  if address
@@ -44,6 +72,8 @@ module VagrantPlugins
44
72
  end
45
73
  end
46
74
  end
75
+ else
76
+ env[:ui].info(I18n.t("vagrant_openstack.not_created"))
47
77
  end
48
78
 
49
79
  @app.call(env)
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module OpenStack
3
- VERSION = "0.10.0"
3
+ VERSION = '0.11.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-openstack-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edmund Haselwanter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-26 00:00:00.000000000 Z
11
+ date: 2014-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog