takelage 0.28.24 → 0.28.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/takelage/lib/system.rb +13 -0
- data/lib/takelage/mutagen/check/daemon.rb +16 -2
- data/lib/takelage/version +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5b24cafbddb28d0bc465c9b464a02d6d08c14639dfe5c58cc891828680143dc
|
4
|
+
data.tar.gz: 7743c6e2f629e35838820ab439c72a6b659c674f852fe7a114e9016d771011af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4135b0857fbbff72ce697309745232b1433352cd7b3a884486044aa761b9a66f15b29ab896a5406cabab35c1b8c941fed2c91c0d2344bd604cbde99ef22fbb5f
|
7
|
+
data.tar.gz: 773c9fdfa99690acc118f837ddbdc343e51f1962f05bd740c312ae7b125713734eb1b591c2f411499f76728e009bc4b175ec128747319a53b614ff88b5c7e071
|
data/lib/takelage/lib/system.rb
CHANGED
@@ -77,6 +77,19 @@ module SystemModule
|
|
77
77
|
stdout_str
|
78
78
|
end
|
79
79
|
|
80
|
+
# Run a command and return the standard output
|
81
|
+
# the standard error and the exit status
|
82
|
+
# @return [[String, String, Integer]] array of
|
83
|
+
# stdout, stderr, exitstatus of command
|
84
|
+
def run_and_capture(command)
|
85
|
+
log.debug "Running amd capturing command \"#{command}\""
|
86
|
+
stdout_str, stderr_str, status = Open3.capture3 command
|
87
|
+
log.debug "Command \"#{command}\" has stdout:\n\"\"\"\n#{stdout_str}\"\"\""
|
88
|
+
log.debug "Command \"#{command}\" has stderr:\n\"\"\"\n#{stderr_str}\"\"\""
|
89
|
+
log.debug "Command \"#{command}\" has exit status: \"#{status.exitstatus}\""
|
90
|
+
[stdout_str, stderr_str, status.exitstatus]
|
91
|
+
end
|
92
|
+
|
80
93
|
# Use Kernel#exec to replace the ruby process with a command.
|
81
94
|
def run_and_exit(command)
|
82
95
|
log.debug "Running command \"#{command}\" and exiting afterwards"
|
@@ -41,14 +41,28 @@ module MutagenCheckDaemon
|
|
41
41
|
private
|
42
42
|
|
43
43
|
# Check mutagen host connection
|
44
|
+
# rubocop:disable Metrics/MethodLength
|
44
45
|
def _mutagen_check_daemon_host_connection
|
45
46
|
check_host_connection = format(
|
46
47
|
config.active['cmd_mutagen_check_daemon_host_connection'],
|
47
48
|
hostlabel: @hostlabel
|
48
49
|
)
|
49
|
-
|
50
|
-
|
50
|
+
stdout, _, exitstatus = run_and_capture check_host_connection
|
51
|
+
|
52
|
+
unless exitstatus.zero?
|
53
|
+
log.debug 'There is no mutagen forward connection to the host'
|
54
|
+
return false
|
55
|
+
end
|
56
|
+
|
57
|
+
unless stdout.include? 'Status: Forwarding connections'
|
58
|
+
log.debug 'The mutagen forward connection to the host ' \
|
59
|
+
'is not forwarding connections'
|
60
|
+
return false
|
61
|
+
end
|
62
|
+
|
63
|
+
true
|
51
64
|
end
|
65
|
+
# rubocop:enable Metrics/MethodLength
|
52
66
|
|
53
67
|
# Check mutagen version
|
54
68
|
def _mutagen_check_daemon_version
|
data/lib/takelage/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.28.
|
1
|
+
0.28.26
|