diff options
author | John Keiser <john@johnkeiser.com> | 2015-12-11 13:19:58 -0800 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-12-15 11:16:20 -0800 |
commit | b743fcdbd172862386d172b42bbbc31cfe2f4239 (patch) | |
tree | aeb3a60c86bbd98c5502b86483848a5cc5122fc3 /lib/chef/provider/package | |
parent | 44494c91587ff0313d328d9c4ec016e6fcf5f830 (diff) | |
download | chef-b743fcdbd172862386d172b42bbbc31cfe2f4239.tar.gz |
Use properties in package resourcesjk/package-properties
Diffstat (limited to 'lib/chef/provider/package')
-rw-r--r-- | lib/chef/provider/package/aix.rb | 1 | ||||
-rw-r--r-- | lib/chef/provider/package/easy_install.rb | 1 | ||||
-rw-r--r-- | lib/chef/provider/package/pacman.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/package/paludis.rb | 3 | ||||
-rw-r--r-- | lib/chef/provider/package/portage.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/package/rpm.rb | 1 | ||||
-rw-r--r-- | lib/chef/provider/package/smartos.rb | 5 | ||||
-rw-r--r-- | lib/chef/provider/package/solaris.rb | 5 | ||||
-rw-r--r-- | lib/chef/provider/package/windows.rb | 4 | ||||
-rw-r--r-- | lib/chef/provider/package/zypper.rb | 1 |
10 files changed, 3 insertions, 22 deletions
diff --git a/lib/chef/provider/package/aix.rb b/lib/chef/provider/package/aix.rb index 5165f4b4ea..80860adba0 100644 --- a/lib/chef/provider/package/aix.rb +++ b/lib/chef/provider/package/aix.rb @@ -47,7 +47,6 @@ class Chef def load_current_resource @current_resource = Chef::Resource::Package.new(@new_resource.name) @current_resource.package_name(@new_resource.package_name) - @new_resource.version(nil) if @new_resource.source @package_source_found = ::File.exists?(@new_resource.source) diff --git a/lib/chef/provider/package/easy_install.rb b/lib/chef/provider/package/easy_install.rb index 2f7880bf08..0b8e3952f7 100644 --- a/lib/chef/provider/package/easy_install.rb +++ b/lib/chef/provider/package/easy_install.rb @@ -67,7 +67,6 @@ class Chef def load_current_resource @current_resource = Chef::Resource::Package.new(@new_resource.name) @current_resource.package_name(@new_resource.package_name) - @current_resource.version(nil) # get the currently installed version if installed package_version = nil diff --git a/lib/chef/provider/package/pacman.rb b/lib/chef/provider/package/pacman.rb index 01e3a9cc01..275a0c7aa7 100644 --- a/lib/chef/provider/package/pacman.rb +++ b/lib/chef/provider/package/pacman.rb @@ -32,8 +32,6 @@ class Chef @current_resource = Chef::Resource::Package.new(@new_resource.name) @current_resource.package_name(@new_resource.package_name) - @current_resource.version(nil) - Chef::Log.debug("#{@new_resource} checking pacman for #{@new_resource.package_name}") status = shell_out_with_timeout("pacman -Qi #{@new_resource.package_name}") status.stdout.each_line do |line| diff --git a/lib/chef/provider/package/paludis.rb b/lib/chef/provider/package/paludis.rb index 2d6302515b..90f02b80ad 100644 --- a/lib/chef/provider/package/paludis.rb +++ b/lib/chef/provider/package/paludis.rb @@ -31,8 +31,6 @@ class Chef @current_resource = Chef::Resource::Package.new(@new_resource.package_name) @current_resource.package_name(@new_resource.package_name) - @current_resource.version(nil) - Chef::Log.debug("Checking package status for #{@new_resource.package_name}") installed = false re = Regexp.new('(.*)[[:blank:]](.*)[[:blank:]](.*)$') @@ -48,7 +46,6 @@ class Chef @current_resource.version(res[2]) else @candidate_version = res[2] - @current_resource.version(nil) end end end diff --git a/lib/chef/provider/package/portage.rb b/lib/chef/provider/package/portage.rb index 95782a6774..a0d0b1a441 100644 --- a/lib/chef/provider/package/portage.rb +++ b/lib/chef/provider/package/portage.rb @@ -35,8 +35,6 @@ class Chef @current_resource = Chef::Resource::Package.new(@new_resource.name) @current_resource.package_name(@new_resource.package_name) - @current_resource.version(nil) - category, pkg = %r{^#{PACKAGE_NAME_PATTERN}$}.match(@new_resource.package_name)[1,2] globsafe_category = category ? Chef::Util::PathHelper.escape_glob(category) : nil diff --git a/lib/chef/provider/package/rpm.rb b/lib/chef/provider/package/rpm.rb index 6ce0dd689f..e3217fdf18 100644 --- a/lib/chef/provider/package/rpm.rb +++ b/lib/chef/provider/package/rpm.rb @@ -50,7 +50,6 @@ class Chef @current_resource = Chef::Resource::Package.new(@new_resource.name) @current_resource.package_name(@new_resource.package_name) - @new_resource.version(nil) if @new_resource.source unless uri_scheme?(@new_resource.source) || ::File.exists?(@new_resource.source) diff --git a/lib/chef/provider/package/smartos.rb b/lib/chef/provider/package/smartos.rb index 71b8a9b9e1..d3d2fa54a1 100644 --- a/lib/chef/provider/package/smartos.rb +++ b/lib/chef/provider/package/smartos.rb @@ -36,7 +36,6 @@ class Chef Chef::Log.debug("#{@new_resource} loading current resource") @current_resource = Chef::Resource::Package.new(@new_resource.name) @current_resource.package_name(@new_resource.package_name) - @current_resource.version(nil) check_package_state(@new_resource.package_name) @current_resource # modified by check_package_state end @@ -50,9 +49,7 @@ class Chef version = info.stdout[/^#{@new_resource.package_name}-(.+)/, 1] end - if !version - @current_resource.version(nil) - else + if version @current_resource.version(version) end end diff --git a/lib/chef/provider/package/solaris.rb b/lib/chef/provider/package/solaris.rb index c0d2beec36..55a34b44dd 100644 --- a/lib/chef/provider/package/solaris.rb +++ b/lib/chef/provider/package/solaris.rb @@ -51,7 +51,6 @@ class Chef def load_current_resource @current_resource = Chef::Resource::Package.new(@new_resource.name) @current_resource.package_name(@new_resource.package_name) - @new_resource.version(nil) if @new_resource.source @package_source_found = ::File.exists?(@new_resource.source) @@ -80,10 +79,6 @@ class Chef raise Chef::Exceptions::Package, "pkginfo failed - #{status.inspect}!" end - unless @current_resource.version.nil? - @current_resource.version(nil) - end - @current_resource end diff --git a/lib/chef/provider/package/windows.rb b/lib/chef/provider/package/windows.rb index ad2a855f2e..b4391774ca 100644 --- a/lib/chef/provider/package/windows.rb +++ b/lib/chef/provider/package/windows.rb @@ -73,7 +73,7 @@ class Chef @new_resource.installer_type elsif source_location.nil? inferred_registry_type - else + else basename = ::File.basename(source_location) file_extension = basename.split(".").last.downcase @@ -149,7 +149,7 @@ class Chef # @return [Array] current_version(s) as an array # this package provider does not support package arrays - # However, There may be multiple versions for a single + # However, There may be multiple versions for a single # package so the first element may be a nested array def current_version_array [ current_resource.version ] diff --git a/lib/chef/provider/package/zypper.rb b/lib/chef/provider/package/zypper.rb index ac42304ffb..72e8d56154 100644 --- a/lib/chef/provider/package/zypper.rb +++ b/lib/chef/provider/package/zypper.rb @@ -63,7 +63,6 @@ class Chef if is_installed==false @candidate_version=version - current_resource.version(nil) end if is_installed==true |