summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Dibowitz <phil@ipom.com>2015-03-03 13:46:04 -0800
committerPhil Dibowitz <phil@ipom.com>2015-03-03 13:47:39 -0800
commit1f380f9f180f39581f2e124061af1ee927a23e0c (patch)
tree7d28112fe7a47664ba78532f23e434b5da77dac2
parent370422ae15a82f4354d047a5d85b49e8797a347e (diff)
downloadchef-1f380f9f180f39581f2e124061af1ee927a23e0c.tar.gz
Allow people to pass in a 'source' to package rules
Fixes #3008
-rw-r--r--lib/chef/provider/package.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb
index 9edf8d5f52..848279e688 100644
--- a/lib/chef/provider/package.rb
+++ b/lib/chef/provider/package.rb
@@ -55,8 +55,11 @@ class Chef
a.whyrun("Assuming a repository that offers #{forced_packages_missing_candidates.join(", ")} would have been configured")
end
+ # XXX: Does it make sense to pass in a source with :upgrade? Probably
+ # not, but as with the above comment, we don't yet enforce such a thing,
+ # so we'll just leave things as-is for now.
requirements.assert(:upgrade, :install) do |a|
- a.assertion { candidates_exist_for_all_uninstalled? }
+ a.assertion { candidates_exist_for_all_uninstalled? || new_resource.source }
a.failure_message(Chef::Exceptions::Package, "No candidate version available for #{packages_missing_candidates.join(", ")}")
a.whyrun("Assuming a repository that offers #{packages_missing_candidates.join(", ")} would have been configured")
end