Class: Puppet::Provider::Package

Inherits:
Puppet::Provider show all
Defined in:
lib/vendor/puppet/provider/package.rb

Constant Summary

Constants included from Util

Util::AbsolutePathPosix, Util::AbsolutePathWindows

Constants included from Util::Docs

Util::Docs::HEADER_LEVELS

Instance Attribute Summary

Attributes inherited from Puppet::Provider

#model, #resource

Attributes included from Util::Docs

#doc, #nodoc

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Puppet::Provider

#<=>, #clear, command, #command, commands, declared_feature?, default?, defaultfor, #get, #initialize, initvars, instances, make_command_methods, mk_resource_methods, mkmodelmethods, #name, optional_commands, #set, specificity, supports_parameter?, #to_s

Methods included from Util::Logging

#clear_deprecation_warnings, #deprecation_warning, #send_log

Methods included from Util

absolute_path?, activerecord_version, benchmark, binread, chuser, classproxy, #execfail, #execpipe, execute, execute_posix, execute_windows, logmethods, memory, path_to_uri, proxy, replace_file, safe_posix_fork, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, #threadlock, uri_to_path, wait_for_output, which, withumask

Methods included from Util::POSIX

#get_posix_field, #gid, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid

Methods included from Util::Docs

#desc, #dochook, #doctable, #markdown_definitionlist, #markdown_header, #nodoc?, #pad, scrub

Methods included from Util::Warnings

clear_warnings, notice_once, warnonce

Methods included from Confiner

#confine, #confine_collection, #suitable?

Methods included from Util::Errors

#adderrorcontext, #devfail, #error_context, #exceptwrap, #fail

Constructor Details

This class inherits a constructor from Puppet::Provider

Class Method Details

.prefetch(packages) ⇒ Object

Prefetch our package list, yo.



3
4
5
6
7
8
9
# File 'lib/vendor/puppet/provider/package.rb', line 3

def self.prefetch(packages)
  instances.each do |prov|
    if pkg = packages[prov.name]
      pkg.provider = prov
    end
  end
end

Instance Method Details

#flushObject

Clear out the cached values.



12
13
14
# File 'lib/vendor/puppet/provider/package.rb', line 12

def flush
  @property_hash.clear
end

#propertiesObject

Look up the current status.



17
18
19
20
21
22
23
# File 'lib/vendor/puppet/provider/package.rb', line 17

def properties
  if @property_hash.empty?
    @property_hash = query || {:ensure => :absent}
    @property_hash[:ensure] = :absent if @property_hash.empty?
  end
  @property_hash.dup
end

#validate_source(value) ⇒ Object



25
26
27
# File 'lib/vendor/puppet/provider/package.rb', line 25

def validate_source(value)
  true
end