Skip to content

Commit 23c2216

Browse files
authored
GHI-6439 - Update the package parsing procedure in the ey-packages recipe (#238)
1 parent 6ca3383 commit 23c2216

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cookbooks/ey-packages/recipes/default.rb

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@
1717

1818
install = node["packages"]["install"]
1919
install.each do |package|
20-
package = JSON.parse(package)
20+
# AI-GEN START - cody
21+
if package.is_a?(String)
22+
package = JSON.parse(package)
23+
elsif !package.is_a?(Hash)
24+
raise "Unexpected type #{package.class} for packages[\"install\"] element"
25+
end
26+
# AI-GEN END
27+
2128
if package != {}
2229
Chef::Log.info "PACKAGES: Installing #{package['name']}-#{package['version']}"
2330
package package["name"] do

0 commit comments

Comments
 (0)