summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManick Vel <mkumaravel@msystechnologies.com>2022-01-28 11:46:41 +0530
committerpratixha <pratiksha.prajapati@msystechnologies.com>2022-05-25 12:13:22 +0530
commit763c5cf942cc5c191226066c4518458ef2c15cb3 (patch)
tree3cd0bda04f02f12f2c240cc09eff2e80639f765f
parent394e75398a84b5bf13b835bc46ed598384eb7bd0 (diff)
downloadchef-763c5cf942cc5c191226066c4518458ef2c15cb3.tar.gz
Replaced source file exists with new resource source
-rw-r--r--lib/chef/provider/package/zypper.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/chef/provider/package/zypper.rb b/lib/chef/provider/package/zypper.rb
index 0f268c2cee..89aef8b9a6 100644
--- a/lib/chef/provider/package/zypper.rb
+++ b/lib/chef/provider/package/zypper.rb
@@ -71,7 +71,7 @@ class Chef
end
def candidate_version
- if source_files_exist?
+ if new_resource.source
logger.trace("#{new_resource} checking rpm status")
shell_out!("rpm", "-qp", "--queryformat", "%{NAME} %{VERSION}-%{RELEASE}\n", new_resource.source).stdout.each_line do |line|
case line
@@ -143,10 +143,6 @@ class Chef
@installed_version[index]
end
- def source_files_exist?
- resolved_source_array.all? { |s| s && ::File.exist?(s) }
- end
-
def zip(names, versions)
names.zip(versions).map do |n, v|
(v.nil? || v.empty?) ? n : "#{n}=#{v}"
@@ -159,7 +155,7 @@ class Chef
end
def zypper_package(command, global_options, *options, names, versions)
- zipped_names = source_files_exist? ? [new_resource.source] : zip(names, versions)
+ zipped_names = new_resource.source ? new_resource.source : zip(names, versions)
if zypper_version < 1.0
shell_out!("zypper", global_options, gpg_checks, command, *options, "-y", names)
else