summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--lib/puppet/networkclient.rb4
-rw-r--r--lib/puppet/type.rb8
-rw-r--r--lib/puppet/type/pfile.rb6
-rw-r--r--test/client/master.rb4
-rw-r--r--test/puppettest.rb12
-rw-r--r--test/server/bucket.rb1
6 files changed, 26 insertions, 9 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])
diff --git a/test/client/master.rb b/test/client/master.rb
index 0a35a78c3..7e447b095 100644
--- a/test/client/master.rb
+++ b/test/client/master.rb
@@ -118,20 +118,24 @@ class TestMasterClient < Test::Unit::TestCase
# Make sure non-string facts don't make things go kablooie
def test_nonstring_facts
+ Puppet.err :a
# Add a nonstring fact
Facter.add("nonstring") do
setcode { 1 }
end
+ Puppet.err :b
assert_equal(1, Facter.nonstring, "Fact was a string from facter")
client = mkclient()
assert(! FileTest.exists?(@createdfile))
+ Puppet.err :c
assert_nothing_raised {
client.run
}
+ Puppet.err :d
end
def test_getplugins
diff --git a/test/puppettest.rb b/test/puppettest.rb
index 5cf247a63..121eee3e2 100644
--- a/test/puppettest.rb
+++ b/test/puppettest.rb
@@ -66,6 +66,7 @@ module TestPuppet
Puppet::Log.newdestination :console
Puppet::Log.level = :debug
#$VERBOSE = 1
+ Puppet.info @method_name
else
Puppet::Log.close
Puppet::Log.newdestination tempfile()
@@ -169,7 +170,8 @@ module TestPuppet
@@tmpfilenum = 1
end
- f = File.join(self.tmpdir(), self.class.to_s + "testfile" + @@tmpfilenum.to_s)
+ f = File.join(self.tmpdir(), self.class.to_s + "_" + @method_name +
+ @@tmpfilenum.to_s)
@@tmpfiles << f
return f
end
@@ -180,7 +182,7 @@ module TestPuppet
else
@@testdirnum = 1
end
- d = File.join(self.tmpdir(), self.class.to_s + "testdir" + @@testdirnum.to_s)
+ d = File.join(self.tmpdir(), self.class.to_s + "_" + @method_name + @@testdirnum.to_s)
@@tmpfiles << d
return d
end
@@ -349,14 +351,16 @@ module ServerTest
if defined? @@port
@@port += 1
else
- @@port = 8085
+ @@port = 20000
end
end
# create a simple manifest that just creates a file
def mktestmanifest
file = File.join(Puppet[:confdir], "%ssite.pp" % (self.class.to_s + "test"))
- @createdfile = File.join(tmpdir(), self.class.to_s + "servermanifesttesting")
+ #@createdfile = File.join(tmpdir(), self.class.to_s + "manifesttesting" +
+ # "_" + @method_name)
+ @createdfile = tempfile()
File.open(file, "w") { |f|
f.puts "file { \"%s\": ensure => file, mode => 755 }\n" % @createdfile
diff --git a/test/server/bucket.rb b/test/server/bucket.rb
index 3169781f8..8171b2740 100644
--- a/test/server/bucket.rb
+++ b/test/server/bucket.rb
@@ -23,7 +23,6 @@ class TestBucket < Test::Unit::TestCase
end
#Puppet.err "#{Process.pid}: %s: %s" % [@num, memory()]
- GC.start
#gcdebug(String)
end