summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-07-03 23:15:15 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-07-03 23:15:15 +0000
commit2e78526b6bf646584feb19adb95a4f5fdd8f8b7a (patch)
tree83ee22f8ef7563580fbbedab1d061ca337b8ad50 /lib
parente57c5131aee017bd015e9419b5a1ceeb306677a7 (diff)
downloadpuppet-2e78526b6bf646584feb19adb95a4f5fdd8f8b7a.tar.gz
puppet-2e78526b6bf646584feb19adb95a4f5fdd8f8b7a.tar.xz
puppet-2e78526b6bf646584feb19adb95a4f5fdd8f8b7a.zip
Some updates resulting from trying to track down a segfault introduced when I upgraded to 1.8.4-5 in Debian. I never found the segfault and had ot downgrade to 1.8.4-1. I expect it will not be encountered in real life, only in testing.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1355 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/networkclient.rb4
-rw-r--r--lib/puppet/type.rb8
-rw-r--r--lib/puppet/type/pfile.rb6
3 files changed, 14 insertions, 4 deletions
diff --git a/lib/puppet/networkclient.rb b/lib/puppet/networkclient.rb
index 09c6bc0ab..d6975c5c2 100644
--- a/lib/puppet/networkclient.rb
+++ b/lib/puppet/networkclient.rb
@@ -57,14 +57,14 @@ module Puppet
method
end
newclient.send(:define_method,method) { |*args|
- #Puppet.info "Calling %s" % method
+ Puppet.debug "Calling %s.%s" % [namespace, method]
#Puppet.info "peer cert is %s" % @http.peer_cert
#Puppet.info "cert is %s" % @http.cert
begin
call("%s.%s" % [namespace, method.to_s],*args)
rescue OpenSSL::SSL::SSLError => detail
raise NetworkClientError,
- "Certificates were not trusted"
+ "Certificates were not trusted: %s" % detail
rescue XMLRPC::FaultException => detail
#Puppet.err "Could not call %s.%s: %s" %
# [namespace, method, detail.faultString]
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index e2aea5318..6a9d1c47b 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -790,8 +790,9 @@ class Type < Puppet::Element
when :meta
self.newmetaparam(self.class.metaparamclass(name), value)
when :param
+ klass = self.class.attrclass(name)
# if they've got a method to handle the parameter, then do it that way
- self.newparam(self.class.attrclass(name), value)
+ self.newparam(klass, value)
else
raise Puppet::Error, "Invalid parameter %s" % [name]
end
@@ -1093,6 +1094,7 @@ class Type < Puppet::Element
if rmdeps
Puppet::Event::Subscription.dependencies(self).each { |dep|
+ #info "Deleting dependency %s" % dep
#begin
# self.unsubscribe(dep)
#rescue
@@ -1101,6 +1103,7 @@ class Type < Puppet::Element
dep.delete
}
Puppet::Event::Subscription.subscribers(self).each { |dep|
+ #info "Unsubscribing from %s" % dep
begin
dep.unsubscribe(self)
rescue
@@ -1161,7 +1164,6 @@ class Type < Puppet::Element
# necessary. FIXME This method should be responsible for most of the
# error handling.
def self.create(hash)
- #Puppet.warning "Creating %s" % hash.inspect
# Handle this new object being implicit
implicit = hash[:implicit] || false
if hash.include?(:implicit)
@@ -1176,6 +1178,8 @@ class Type < Puppet::Element
end
name = hash.name
+ #Puppet.debug "Creating %s[%s]" % [self.name, name]
+
# if the object already exists
if self.isomorphic? and retobj = self[name]
# if only one of our objects is implicit, then it's easy to see
diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb
index 7e6b365df..5f9d98ded 100644
--- a/lib/puppet/type/pfile.rb
+++ b/lib/puppet/type/pfile.rb
@@ -785,6 +785,12 @@ module Puppet
if self.class.name == :file and self[:links] != :follow
method = :lstat
end
+ path = self[:path]
+ # Just skip them when they don't exist at all.
+ unless FileTest.exists?(path) or FileTest.symlink?(path)
+ @stat = nil
+ return @stat
+ end
if @stat.nil? or refresh == true
begin
@stat = File.send(method, self[:path])