class Chef::Provider::Package::Yum::YumCache

Public Instance Methods

available_version(name, arch = nil) click to toggle source
# File lib/chef/provider/package/yum/yum_cache.rb, line 60
def available_version(name, arch = nil)
  p = python_helper.package_query(:whatavailable, name, arch: arch)
  "#{p.version}.#{p.arch}" unless p.version.nil?
end
installed_version(name, arch = nil) click to toggle source
# File lib/chef/provider/package/yum/yum_cache.rb, line 65
def installed_version(name, arch = nil)
  p = python_helper.package_query(:whatinstalled, name, arch: arch)
  "#{p.version}.#{p.arch}" unless p.version.nil?
end
package_available?(name, arch = nil) click to toggle source
# File lib/chef/provider/package/yum/yum_cache.rb, line 70
def package_available?(name, arch = nil)
  p = python_helper.package_query(:whatavailable, name, arch: arch)
  !p.version.nil?
end
python_helper() click to toggle source

@api private

# File lib/chef/provider/package/yum/yum_cache.rb, line 85
def python_helper
  @python_helper ||= PythonHelper.instance
end
refresh() click to toggle source
# File lib/chef/provider/package/yum/yum_cache.rb, line 36
def refresh
  python_helper.restart
end
reload() click to toggle source
# File lib/chef/provider/package/yum/yum_cache.rb, line 40
def reload
  python_helper.restart
end
reload_installed() click to toggle source
# File lib/chef/provider/package/yum/yum_cache.rb, line 44
def reload_installed
  python_helper.restart
end
reload_provides() click to toggle source
# File lib/chef/provider/package/yum/yum_cache.rb, line 48
def reload_provides
  python_helper.restart
end
reset() click to toggle source
# File lib/chef/provider/package/yum/yum_cache.rb, line 52
def reset
  python_helper.restart
end
reset_installed() click to toggle source
# File lib/chef/provider/package/yum/yum_cache.rb, line 56
def reset_installed
  python_helper.restart
end
version_available?(name, version, arch = nil) click to toggle source

NOTE that it is the responsibility of the python_helper to get these APIs correct and we do not do any validation here that the e.g. version or arch matches the requested value (because the bigger issue there is a buggy+broken python_helper – so don't try to fix those kinds of bugs here)

# File lib/chef/provider/package/yum/yum_cache.rb, line 79
def version_available?(name, version, arch = nil)
  p = python_helper.package_query(:whatavailable, name, version: version, arch: arch)
  !p.version.nil?
end