chef-powershell 2.18.5 → 2.18.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ruby_bin_folder/AMD64/Chef.PowerShell.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/Chef.Powershell.Wrapper.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
- data/lib/chef-powershell/powershell.rb +8 -4
- data/lib/chef-powershell/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: f019aa6ec88c30ebe38c6a43aa2200421ba37f6d0b8205cbd58ddccec496f8e8
|
4
|
+
data.tar.gz: 313478b0ad0850b795de5cf0a54db8a970341b5f8fa06ca39c030cf9135dc82f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e5be4e69ae8804a3eebabbcbf0dd1b39079e28b17d42f6085d67f6832ac0cc52285753fa87109688dd96b79bc4410b3f8b2e2e836b1659aae73a62c3d997b3c
|
7
|
+
data.tar.gz: 5b6952643227ac0dfa25b5818288e5dfed465e871e842d618a46636dd2702153531715fe80f86c0cbebc0d22ba2cd0dc583a537b205f8d2a845e7d91f5a59f8e
|
Binary file
|
Binary file
|
data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll
CHANGED
Binary file
|
@@ -80,21 +80,25 @@ class ChefPowerShell
|
|
80
80
|
# try parsing the result *first* before returning from the function, and if it fails,
|
81
81
|
# return false so that the function can be retried from the C++ side.
|
82
82
|
begin
|
83
|
-
|
84
|
-
@result_string = data.get_bytes(0, size).force_encoding("UTF-16LE").encode("UTF-8").bytes.reverse.drop_while {|x| x == 0}.reverse.pack("C*")
|
83
|
+
@result_string = data.get_bytes(0, size).force_encoding("UTF-16LE").encode("UTF-8")
|
85
84
|
@hashed_outcome = FFI_Yajl::Parser.parse(@result_string)
|
86
85
|
@result = FFI_Yajl::Parser.parse(@hashed_outcome["result"])
|
87
86
|
@errors = @hashed_outcome["errors"]
|
88
87
|
@verbose = @hashed_outcome["verbose"]
|
89
88
|
true
|
90
|
-
rescue => e
|
89
|
+
rescue NoMethodError, FFI_Yajl::ParseError => e
|
91
90
|
@retry_count += 1
|
92
|
-
|
91
|
+
# capture exception so that it can be raised later, since otherwise
|
92
|
+
# we will be raising back to C++.
|
93
93
|
@exception = e
|
94
94
|
return true if @retry_count > 3
|
95
95
|
puts "Retrying PowerShell command execution #{@retry_count}"
|
96
96
|
sleep 1
|
97
97
|
false
|
98
|
+
rescue => e
|
99
|
+
# no retry for other exceptions
|
100
|
+
@exception = e
|
101
|
+
true
|
98
102
|
end
|
99
103
|
end
|
100
104
|
|