summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/provider')
-rwxr-xr-xlib/puppet/provider/mailalias/aliases.rb5
-rwxr-xr-xlib/puppet/provider/package/openbsd.rb12
-rw-r--r--lib/puppet/provider/zone/solaris.rb3
3 files changed, 16 insertions, 4 deletions
diff --git a/lib/puppet/provider/mailalias/aliases.rb b/lib/puppet/provider/mailalias/aliases.rb
index 85dec29cc..8b5c45617 100755
--- a/lib/puppet/provider/mailalias/aliases.rb
+++ b/lib/puppet/provider/mailalias/aliases.rb
@@ -10,7 +10,10 @@ Puppet::Type.type(:mailalias).provide(:aliases,
record_line :aliases, :fields => %w{name recipient}, :separator => /\s*:\s*/, :block_eval => :instance do
def post_parse(record)
- record[:recipient] = record[:recipient].split(/\s*,\s*/).collect { |d| d.gsub(/^['"]|['"]$/, '') }
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ # It's not sufficient to assign to an existing hash.
+ recipient = record[:recipient].split(/\s*,\s*/).collect { |d| d.gsub(/^['"]|['"]$/, '') }
+ record[:recipient] = recipient
record
end
diff --git a/lib/puppet/provider/package/openbsd.rb b/lib/puppet/provider/package/openbsd.rb
index f76c37176..af590eb4d 100755
--- a/lib/puppet/provider/package/openbsd.rb
+++ b/lib/puppet/provider/package/openbsd.rb
@@ -2,6 +2,7 @@ require 'puppet/provider/package'
# Packaging on OpenBSD. Doesn't work anywhere else that I know of.
Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Package do
+ include Puppet::Util::Execution
desc "OpenBSD's form of ``pkg_add`` support."
commands :pkginfo => "pkg_info", :pkgadd => "pkg_add", :pkgdelete => "pkg_delete"
@@ -58,7 +59,14 @@ Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Packa
"You must specify a package source for BSD packages"
end
- pkgadd @resource[:source]
+ if @resource[:source] =~ /\/$/
+ withenv :PKG_PATH => @resource[:source] do
+ pkgadd @resource[:name]
+ end
+ else
+ pkgadd @resource[:source]
+ end
+
end
def query
@@ -67,7 +75,7 @@ Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Packa
# Search for the version info
if info =~ /Information for (inst:)?#{@resource[:name]}-(\S+)/
- hash[:ensure] = $1
+ hash[:ensure] = $2
else
return nil
end
diff --git a/lib/puppet/provider/zone/solaris.rb b/lib/puppet/provider/zone/solaris.rb
index dd8698b92..be2dd97f9 100644
--- a/lib/puppet/provider/zone/solaris.rb
+++ b/lib/puppet/provider/zone/solaris.rb
@@ -26,7 +26,8 @@ Puppet::Type.type(:zone).provide(:solaris) do
end
def self.instances
- adm(:list, "-cp").split("\n").collect do |line|
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = adm(:list, "-cp").split("\n").collect do |line|
new(line2hash(line))
end
end