staypuft 0.5.11 → 0.5.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfd9909dd712c0201b515446f4951be152eee735
4
- data.tar.gz: 7c7c028f24023a15f0e4fc7cc642b1cb1509dca3
3
+ metadata.gz: bd64239cd0fdf64f05f4ece53506110596323911
4
+ data.tar.gz: 113d7d8b349b75bb5774503963ac8b17b8d3eb36
5
5
  SHA512:
6
- metadata.gz: b829c2dd39969931c524737861114872bed3deb45b432e1a6eb9077cd1e6d376f3cdb01828d180e39b9ffdd4177d8fd2258f9660c2b5d056dcee47f3ec8fdde0
7
- data.tar.gz: 4f882c8cb18b443546a518d6b66f8a1d84c249c7896e8a8b45edd8fffc658d84c9f07d1445cc23150d896b02695231788a9777d5fe514d79b5f51a0f935a4f4e
6
+ metadata.gz: 7c8ceedace14908cc583ebeda720605ab7ac771358d47d914c2325a29307f8aa701ce9a3f931c04d0c11e21936f4a09f57afe3ed93346e0acc246860660cc82b
7
+ data.tar.gz: 2813a4656231e0517ea90ffc4de30bc7dd742f4756ef9364b244139ef60c3aaf3e5f52d7f741f56cc541889a56dfd663c67d5042765669824e0a2836e2746d4b
@@ -16,6 +16,8 @@ module Actions
16
16
 
17
17
  class WaitUntilReady < Actions::Base
18
18
 
19
+ STARTUP_GRACE_PERIOD = 60
20
+
19
21
  middleware.use Actions::Staypuft::Middleware::AsCurrentUser
20
22
  include Dynflow::Action::Polling
21
23
 
@@ -42,14 +44,26 @@ module Actions
42
44
  end
43
45
 
44
46
  def poll_external_task
45
- host = ::Host.find input.fetch(:host_id)
46
- host.send :ssh_open?, host.ip
47
+ if !output[:ssh_port_open_at] && check_ssh_port_open
48
+ output[:ssh_port_open_at] ||= Time.now.to_i
49
+ end
50
+
51
+ if output[:ssh_port_open_at]
52
+ Time.now.to_i - output[:ssh_port_open_at] > STARTUP_GRACE_PERIOD
53
+ else
54
+ false
55
+ end
47
56
  end
48
57
 
49
58
  def poll_interval
50
59
  5
51
60
  end
52
61
 
62
+ def check_ssh_port_open
63
+ host = ::Host.find input.fetch(:host_id)
64
+ host.send :ssh_open?, host.ip
65
+ end
66
+
53
67
  end
54
68
  end
55
69
  end
@@ -1,3 +1,3 @@
1
1
  module Staypuft
2
- VERSION = '0.5.11'
2
+ VERSION = '0.5.12'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staypuft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.11
4
+ version: 0.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Staypuft team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-13 00:00:00.000000000 Z
11
+ date: 2015-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks