simple_provision 0.99.6 → 0.99.7

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: c1ff2a55eb683cc8e6f25b12c8565bd62c93bc99
4
- data.tar.gz: 2ac7128c70fde4cac971896fab7132a46e9446f5
3
+ metadata.gz: 1880038fa6fc6527cc8254327d4d437b3992879d
4
+ data.tar.gz: c6d6ed67a21d7a2e550b26dc4447dae7562e74fc
5
5
  SHA512:
6
- metadata.gz: a6fb5a3e387013d6db44ab56e0ba6213f0d762d0ffbcd4dc72afacebe0e6232a3ef4cbf51a3503094af68fbe2a7a026a8959c1a4cb05819d8ee58943a859168a
7
- data.tar.gz: 67d345ad0b1fe411acc5c14710025153dde7dc3e91ddc8b1474b00161e824aa42825a3cf4b1eddc0f14a4cafef59b2e6ca1c8d99a86d9996e2117513c2e2c48e
6
+ metadata.gz: b568f45887448deabba648a8bf9b382d780ffa4f2deba649805e6733a4ba994b4f6a2f8099a16f5adc4edb4846630b6af753499f638c6401119bec3812a69177
7
+ data.tar.gz: a43dbbdaa583a1a3a49ee94242e87261652d9c5137fae681d455dec3398496fc18ca46e1e87953c5fb84b8162f7e48754f2926163cc0233a0e966ad9d39ef0db
@@ -14,14 +14,35 @@ module SimpleProvision
14
14
  end
15
15
 
16
16
  def configure
17
- Net::SSH.start(host, username) do |ssh|
18
- ssh.exec! "tar -xzf #{SimpleProvision::SCP::FILENAME}"
19
- scripts = options.fetch(:scripts).each do |script|
20
- puts "Execute #{script}"
21
- ssh.exec!("#{environment_exports} bash -c '#{script}'") do |channel, stream, data|
22
- print data
17
+ begin
18
+ Net::SSH.start(host, username) do |ssh|
19
+ ssh.exec! "tar -xzf #{SimpleProvision::SCP::FILENAME}"
20
+ scripts = options.fetch(:scripts).each do |script|
21
+ puts "Execute #{script}"
22
+ ssh.open_channel do |ssh_channel|
23
+ ssh_channel.request_pty
24
+ ssh_channel.exec("#{environment_exports} bash -c '#{script}'") do |channel, success|
25
+ unless success
26
+ raise "Could not execute command: #{command.inspect}"
27
+ end
28
+
29
+ channel.on_data do |ch, data|
30
+ STDOUT << data
31
+ end
32
+
33
+ channel.on_extended_data do |ch, type, data|
34
+ next unless type == 1
35
+ STDERR << data
36
+ end
37
+ end
38
+ end
39
+ ssh.loop
23
40
  end
24
41
  end
42
+ rescue Net::SSH::HostKeyMismatch => exception
43
+ exception.remember_host!
44
+ sleep 0.2
45
+ retry
25
46
  end
26
47
  end
27
48
 
@@ -1,3 +1,3 @@
1
1
  module SimpleProvision
2
- VERSION = "0.99.6"
2
+ VERSION = "0.99.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_provision
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.99.6
4
+ version: 0.99.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phuong Gia Su
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-12 00:00:00.000000000 Z
12
+ date: 2014-07-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler