Class: Puppet::Provider::Package

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

Overview

Created by Luke A. Kanies on 2007-06-05.

Copyright (c) 2007. All rights reserved.

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

#send_log

Methods included from Util

activerecord_version, benchmark, chuser, classproxy, #execfail, #execpipe, execute, logmethods, memory, proxy, recmkdir, secure_open, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, #threadlock, 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, #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.



6
7
8
9
10
11
12
# File 'lib/puppet/provider/package.rb', line 6

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.



15
16
17
# File 'lib/puppet/provider/package.rb', line 15

def flush
  @property_hash.clear
end

#propertiesObject

Look up the current status.



20
21
22
23
24
25
26
# File 'lib/puppet/provider/package.rb', line 20

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