From b722458fdd692c5aac8a86695cd365f226c16913 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 13 Mar 2018 12:23:25 -0700 Subject: fix superclass edits Signed-off-by: Lamont Granquist --- lib/chef/provider/package.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/chef/provider') diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb index 1b2b6d7659..b63b1b92b5 100644 --- a/lib/chef/provider/package.rb +++ b/lib/chef/provider/package.rb @@ -225,7 +225,7 @@ class Chef else package_locked(new_resource.package_name, new_resource.version) end - unless package_locked(new_resource.package_name, new_resource.version) + unless packages_locked description = new_resource.version ? "version #{new_resource.version} of " : "" converge_by("lock #{description}package #{current_resource.package_name}") do multipackage_api_adapter(current_resource.package_name, new_resource.version) do |name, version| @@ -239,12 +239,12 @@ class Chef end def action_unlock - packages_locked = if respond_to?(:packages_all_unlocked?) - packages_all_unlocked?(Array(new_resource.package_name), Array(new_resource.version)) - else - package_locked(new_resource.package_name, new_resource.version) - end - if package_locked(new_resource.package_name, new_resource.version) + packages_unlocked = if respond_to?(:packages_all_unlocked?) + packages_all_unlocked?(Array(new_resource.package_name), Array(new_resource.version)) + else + !package_locked(new_resource.package_name, new_resource.version) + end + unless packages_unlocked description = new_resource.version ? "version #{new_resource.version} of " : "" converge_by("unlock #{description}package #{current_resource.package_name}") do multipackage_api_adapter(current_resource.package_name, new_resource.version) do |name, version| -- cgit v1.2.1