summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Dibowitz <phil@ipom.com>2015-03-03 15:00:56 -0800
committerPhil Dibowitz <phil@ipom.com>2015-03-03 15:00:56 -0800
commited5f7c386ca634463612b2fe0a4ae8bcfc2211db (patch)
treeeec5860ecdbb02b6e22cbe0ef2f3095b9f99fc21
parent3eb33e32034583b02181fb7bd5e28c11c5c5d6e8 (diff)
parent1f380f9f180f39581f2e124061af1ee927a23e0c (diff)
downloadchef-ed5f7c386ca634463612b2fe0a4ae8bcfc2211db.tar.gz
Merge pull request #3013 from jaymzh/multipackagefix
Allow people to pass in a 'source' to package rules
-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 de6d399ee3..814b409690 100644
--- a/lib/chef/provider/package.rb
+++ b/lib/chef/provider/package.rb
@@ -54,8 +54,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