diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2020-12-28 12:48:49 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2021-01-04 17:18:00 -0800 |
commit | c02b1a16926d14fdbe9284e4c7bf4ead5a3a944b (patch) | |
tree | dba0669566775dda1e7a30b3725825aae9a549d6 | |
parent | 0cb2ed0cd7b9f2d146a8afa25216db6c2aca0f95 (diff) | |
download | chef-c02b1a16926d14fdbe9284e4c7bf4ead5a3a944b.tar.gz |
chefstyle
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | lib/chef/provider/package/dnf.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/chef/provider/package/dnf.rb b/lib/chef/provider/package/dnf.rb index 5e1e767bb4..5c74ad0414 100644 --- a/lib/chef/provider/package/dnf.rb +++ b/lib/chef/provider/package/dnf.rb @@ -225,22 +225,22 @@ class Chef def magical_version(index) @magical_version ||= [] @magical_version[index] ||= if new_resource.source - python_helper.package_query(:whatinstalled, available_version(index).name, version: safe_version_array[index], arch: safe_arch_array[index], options: options) - else - python_helper.package_query(:whatinstalled, package_name_array[index], version: safe_version_array[index], arch: safe_arch_array[index], options: options) - end + python_helper.package_query(:whatinstalled, available_version(index).name, version: safe_version_array[index], arch: safe_arch_array[index], options: options) + else + python_helper.package_query(:whatinstalled, package_name_array[index], version: safe_version_array[index], arch: safe_arch_array[index], options: options) + end @magical_version[index] end - def current_version(index) - @current_version ||= [] - @current_version[index] ||= if new_resource.source - python_helper.package_query(:whatinstalled, available_version(index).name, arch: safe_arch_array[index], options: options) - else - python_helper.package_query(:whatinstalled, package_name_array[index], arch: safe_arch_array[index], options: options) - end - @current_version[index] - end + def current_version(index) + @current_version ||= [] + @current_version[index] ||= if new_resource.source + python_helper.package_query(:whatinstalled, available_version(index).name, arch: safe_arch_array[index], options: options) + else + python_helper.package_query(:whatinstalled, package_name_array[index], arch: safe_arch_array[index], options: options) + end + @current_version[index] + end # cache flushing is accomplished by simply restarting the python helper. this produces a roughly # 15% hit to the runtime of installing/removing/upgrading packages. correctly using multipackage |