x_aeon_agents 2.4.1 → 2.4.2
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/x_aeon_agents/helpers.rb +18 -7
- data/lib/x_aeon_agents/version.rb +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: b0c0ecbc190f2b15589772c769e542a5ed7442a57b89e189870d4223189499a2
|
|
4
|
+
data.tar.gz: 216c53061eb6a97a312eb6ba1699808afb08976cddf73c895f4c9b440fa6c3e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d2632088da899f189c3151589c197add2ab86aa3e7116d7e8d9b62814c820c1eeacbe65dc8bedee06ad975b2bc7212f7a92d91d499e36852789dc443b55d10d
|
|
7
|
+
data.tar.gz: 03ea4dce0983a8e34be65df2069729b9bab0b7cbf0468849098d25b9b22b8c9cd3debc94a9e1b0aa036943a91c6ebcc5a33a286ef0ace744efcf274e27163487
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
# [v2.4.2](https://github.com/Muriel-Salvan/x_aeon_agents/compare/v2.4.1...v2.4.2) (2026-11-04 10:39:50)
|
|
2
|
+
|
|
3
|
+
### Patches
|
|
4
|
+
|
|
5
|
+
* [refactor(helpers): improve run_cmd variable handling and debug logging](https://github.com/Muriel-Salvan/x_aeon_agents/commit/06c0554d12ba667fb23435c6fb36eb0f67754617)
|
|
6
|
+
|
|
1
7
|
# [v2.4.1](https://github.com/Muriel-Salvan/x_aeon_agents/compare/v2.4.0...v2.4.1) (2026-11-03 13:55:35)
|
|
2
8
|
|
|
3
9
|
### Patches
|
|
@@ -21,34 +21,45 @@ module XAeonAgents
|
|
|
21
21
|
# - stderr [String] Full stderr
|
|
22
22
|
# - exit_status [Integer] Exit status
|
|
23
23
|
def run_cmd(cmd, expected_exit_status: 0)
|
|
24
|
+
stdout = nil
|
|
25
|
+
stderr = nil
|
|
26
|
+
exit_status = nil
|
|
24
27
|
stdout_lines = []
|
|
25
28
|
stderr_lines = []
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
stdin.close
|
|
29
|
+
Open3.popen3(cmd) do |cmd_stdin, cmd_stdout, cmd_stderr, wait_thr|
|
|
30
|
+
cmd_stdin.close
|
|
29
31
|
[
|
|
30
32
|
# Parse stdout
|
|
31
33
|
Thread.new do
|
|
32
|
-
|
|
34
|
+
cmd_stdout.each_line do |line|
|
|
33
35
|
stdout_lines << line
|
|
34
36
|
end
|
|
35
37
|
end,
|
|
36
38
|
# Parse stderr
|
|
37
39
|
Thread.new do
|
|
38
|
-
|
|
40
|
+
cmd_stderr.each_line do |line|
|
|
39
41
|
stderr_lines << line
|
|
40
42
|
end
|
|
41
43
|
end
|
|
42
44
|
].each(&:join)
|
|
43
45
|
exit_status = wait_thr.value.exitstatus
|
|
46
|
+
stdout = stdout_lines.join
|
|
47
|
+
stderr = stderr_lines.join
|
|
44
48
|
Config.logger.debug "Command `#{cmd}` exited with status: #{exit_status}"
|
|
49
|
+
Config.logger.debug <<~EO_DEBUG_OUTPUT
|
|
50
|
+
===== STDOUT
|
|
51
|
+
#{stdout}
|
|
52
|
+
===== STDERR
|
|
53
|
+
#{stderr}
|
|
54
|
+
===== END OF STDERR
|
|
55
|
+
EO_DEBUG_OUTPUT
|
|
45
56
|
if !expected_exit_status.nil? && exit_status != expected_exit_status
|
|
46
57
|
raise UnexpectedExitStatusError, "Command `#{cmd}` exited with status #{exit_status} (expected #{expected_exit_status})"
|
|
47
58
|
end
|
|
48
59
|
end
|
|
49
60
|
{
|
|
50
|
-
stdout
|
|
51
|
-
stderr
|
|
61
|
+
stdout:,
|
|
62
|
+
stderr:,
|
|
52
63
|
exit_status:
|
|
53
64
|
}
|
|
54
65
|
end
|