do_snapshot 0.3.4 → 0.3.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92668154f41ca237cb584baa7630ebd35f481fa5
|
4
|
+
data.tar.gz: 56e4de3f54e5fb70ff87de521637b3551ea31611
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ff26571fd4354ad276274a0a10ed28d3cffec5007a37b50d5d84538bbd4b56e14442156339793ab72539f3de8d9b654b8f13c9d9bcee371b4e5907066370964
|
7
|
+
data.tar.gz: c41d2e7198bd4109d3be78f1af0b9f46e3bb451a62306a2374f38ef9fa125f6686c988fc83f4282585defae44aedf3167ecf97be767ea661e35cf9eeaaaeb048
|
@@ -24,7 +24,7 @@ module DoSnapshot
|
|
24
24
|
|
25
25
|
def check_keys; end
|
26
26
|
|
27
|
-
# Waiting
|
27
|
+
# Waiting wrapper
|
28
28
|
def wait_wrap(id, message = "Event Id: #{id}", &status_block)
|
29
29
|
logger.debug message
|
30
30
|
time = Time.now
|
@@ -36,7 +36,7 @@ module DoSnapshot
|
|
36
36
|
wait_wrap(event_id) { |id, time| get_event_status(id, time) }
|
37
37
|
end
|
38
38
|
|
39
|
-
# Waiting for
|
39
|
+
# Waiting for droplet shutdown
|
40
40
|
def wait_shutdown(droplet_id)
|
41
41
|
wait_wrap(droplet_id, "Droplet Id: #{droplet_id} shutting down") { |id, time| get_shutdown_status(id, time) }
|
42
42
|
end
|
@@ -51,18 +51,22 @@ module DoSnapshot
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
# Event request timeout.
|
55
|
+
#
|
54
56
|
def timeout?(id, time, message = "Event #{id} finished by timeout #{time}")
|
55
57
|
return false unless (Time.now - time) > @timeout
|
56
58
|
logger.debug message
|
57
59
|
true
|
58
60
|
end
|
59
61
|
|
62
|
+
# Droplet request timeout
|
63
|
+
#
|
60
64
|
def droplet_timeout?(id, time)
|
61
65
|
timeout? id, time, "Droplet id: #{id} shutdown event closed by timeout #{time}"
|
62
66
|
end
|
63
67
|
|
64
|
-
# Looking for
|
65
|
-
# Before snapshot we to know that machine
|
68
|
+
# Looking for droplet status.
|
69
|
+
# Before snapshot we need to know that machine is powered off.
|
66
70
|
#
|
67
71
|
def get_shutdown_status(id, time)
|
68
72
|
fail "Droplet #{id} not responding for shutdown!" if droplet_timeout?(id, time)
|
data/lib/do_snapshot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: do_snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Merkulov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|