summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-04-15 14:30:37 -0700
committerGitHub <noreply@github.com>2020-04-15 14:30:37 -0700
commitf7814f3186ae6bcaaca59b5723b23559a0b4b4fd (patch)
tree9868bbddd97e2ffdc3aeeaccf99cf4a1f91a3d78 /lib/chef
parent951ea92875f5999b5508465e6e4e1f82fab39bda (diff)
parent936025c20767cc6cd4ecd439b77bb21c2adbbec4 (diff)
downloadchef-f7814f3186ae6bcaaca59b5723b23559a0b4b4fd.tar.gz
Merge pull request #9649 from MsysTechnologiesllc/dh/fix-msu-pkg-cumulative-update
msu_package: Fix cumulative updates installation and provide a 3600s default timeout
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/provider/package/cab.rb2
-rw-r--r--lib/chef/provider/package/msu.rb1
-rw-r--r--lib/chef/resource/msu_package.rb5
3 files changed, 7 insertions, 1 deletions
diff --git a/lib/chef/provider/package/cab.rb b/lib/chef/provider/package/cab.rb
index 71c649173f..3ede6dbe10 100644
--- a/lib/chef/provider/package/cab.rb
+++ b/lib/chef/provider/package/cab.rb
@@ -93,7 +93,7 @@ class Chef
split_package_identity(p["package_identity"])
end
found_packages = existing_package_identities.select do |existing_package_ident|
- existing_package_ident["name"] == package["name"]
+ existing_package_ident["version"] == package["version"].chomp && existing_package_ident["name"] == package["name"]
end
if found_packages.empty?
nil
diff --git a/lib/chef/provider/package/msu.rb b/lib/chef/provider/package/msu.rb
index 2c67e36e06..a8a8da858a 100644
--- a/lib/chef/provider/package/msu.rb
+++ b/lib/chef/provider/package/msu.rb
@@ -110,6 +110,7 @@ class Chef
@cab_files.each do |cab_file|
declare_resource(:cab_package, new_resource.name) do
source cab_file
+ timeout new_resource.timeout
action :install
end
end
diff --git a/lib/chef/resource/msu_package.rb b/lib/chef/resource/msu_package.rb
index c801cdd971..d07d7893a3 100644
--- a/lib/chef/resource/msu_package.rb
+++ b/lib/chef/resource/msu_package.rb
@@ -44,6 +44,11 @@ class Chef
property :checksum, String, desired_state: false,
description: "SHA-256 digest used to verify the checksum of the downloaded MSU package."
+
+ property :timeout, [String, Integer],
+ default: 3600,
+ description: "The amount of time (in seconds) to wait before timing out.",
+ desired_state: false
end
end
end