vagrant-openstack-cloud-provider 1.1.10 → 1.1.11

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: a0485390c70b7dfaeb04bfd416fecafb72e5d7d1
4
- data.tar.gz: 0c9f67996fdcfb1ca5b13def83560b9d142b3a70
3
+ metadata.gz: 90a622141c798650755c827e3c69b274281ca800
4
+ data.tar.gz: 7199317a5e4268d3ccfc9eff91126f84edf3dd48
5
5
  SHA512:
6
- metadata.gz: 15ebcaa621e8b1b07a955d3287e5bcb52844ac18110521a5c65c6ceac91b607d6738a4a4998bfde9f905173717daeae76fad1c16f6c5626256715f6e49020f25
7
- data.tar.gz: 83f140f1a941a0547ba18c1f5c3bce7581ec6ab51e21e9f8294c5ccd25c92d5a0035d8e5bbf8cffee62601b1852656afa132793aee0dc0133c9f6ed3314240cd
6
+ metadata.gz: b3b8ab12b361550eec73e978b4177572ed6f0fa913ee13ea5dea7e0cfb335cc4a6d099342b77536af29635acee728547c948c48582f75edbda6fa3f9b20f74ae
7
+ data.tar.gz: 4379ae1060288ba27cee8e29fc412f59b7f60e24667196df3c88b7f97dd4d82412ad87aa4adb00ed41045919f75c09a94afba06adcbd50e8aabf462f3e45bb50
@@ -156,9 +156,12 @@ module VagrantPlugins
156
156
  end
157
157
  sleep sleep_interval
158
158
  end
159
- raise unless env[:machine].communicate.ready?
160
- rescue
161
- raise Errors::SshUnavailable
159
+ unless env[:machine].communicate.ready?
160
+ raise Errors::SshWaitTimeout.new(
161
+ :seconds => sleep_interval * (timeout / sleep_interval))
162
+ end
163
+ rescue Exception => msg
164
+ raise Errors::SshUnavailable.new(:error => msg)
162
165
  end
163
166
  end
164
167
 
@@ -11,6 +11,10 @@ module VagrantPlugins
11
11
  error_key(:create_bad_state)
12
12
  end
13
13
 
14
+ class SshWaitTimeout < VagrantOpenStackError
15
+ error_key(:ssh_wait_timeout)
16
+ end
17
+
14
18
  class SshUnavailable < VagrantOpenStackError
15
19
  error_key(:ssh_unavailable)
16
20
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module OpenStack
3
- VERSION = "1.1.10"
3
+ VERSION = "1.1.11"
4
4
  end
5
5
  end
data/locales/en.yml CHANGED
@@ -37,9 +37,10 @@ en:
37
37
  state: '%{state}', instead of properly booting. Run `vagrant status`
38
38
  to find out what can be done about this state, or `vagrant destroy`
39
39
  if you want to start over.
40
+ ssh_wait_timeout: |-
41
+ The server is not ready for SSH communication after %{seconds} seconds.
40
42
  ssh_unavailable: |-
41
- The server has been created successfully but it refuses incomming
42
- ssh connections.
43
+ The server's SSH failed to become available because: %{error}.
43
44
  no_matching_flavor: |-
44
45
  No matching flavor was found! Please check your flavor setting
45
46
  to make sure you have a valid flavor chosen.
@@ -2,6 +2,9 @@ require 'spec_helper'
2
2
  require 'vagrant-openstack-cloud-provider/errors'
3
3
  require 'vagrant-openstack-cloud-provider/action/create_server'
4
4
 
5
+ I18n.load_path << File.expand_path("locales/en.yml", Pathname.new(File.expand_path("../../../../", __FILE__)))
6
+ I18n.reload!
7
+
5
8
  RSpec.describe VagrantPlugins::OpenStack::Action::CreateServer do
6
9
  describe '#server_to_be_available?' do
7
10
  subject {
@@ -45,7 +48,23 @@ RSpec.describe VagrantPlugins::OpenStack::Action::CreateServer do
45
48
  expect(machine).to receive(:communicate).at_least(:once).and_return(communicate)
46
49
 
47
50
  env = { :ui => ui, :interrupted => false, :machine => machine }
48
- expect { subject.send('ssh_is_responding?', env, timeout=0.005, sleep_interval=0.001) }.to raise_error(VagrantPlugins::OpenStack::Errors::SshUnavailable)
51
+ expect { subject.send('ssh_is_responding?', env, timeout=0.005, sleep_interval=0.001) }.
52
+ to raise_error(VagrantPlugins::OpenStack::Errors::SshUnavailable).
53
+ with_message(I18n.t('vagrant_openstack.errors.ssh_unavailable',
54
+ :error => I18n.t('vagrant_openstack.errors.ssh_wait_timeout',
55
+ :seconds => 0.005)))
56
+ end
57
+
58
+ it 'should show any error raised' do
59
+ expect(ui).to receive(:info).at_least(:once)
60
+ expect(communicate).to receive(:ready?).once.and_raise(Exception.new("waaaat"))
61
+ expect(machine).to receive(:communicate).at_least(:once).and_return(communicate)
62
+
63
+ env = { :ui => ui, :interrupted => false, :machine => machine }
64
+ expect { subject.send('ssh_is_responding?', env, timeout=0.005, sleep_interval=0.001) }.
65
+ to raise_error(VagrantPlugins::OpenStack::Errors::SshUnavailable).
66
+ with_message(I18n.t('vagrant_openstack.errors.ssh_unavailable',
67
+ :error => 'waaaat'))
49
68
  end
50
69
  end
51
70
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-openstack-cloud-provider
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10
4
+ version: 1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathieu Mitchell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-27 00:00:00.000000000 Z
11
+ date: 2017-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog