From 21244f4f69c89f92b0ec451e5122774de3c548e3 Mon Sep 17 00:00:00 2001 From: luke Date: Tue, 6 Sep 2005 04:20:53 +0000 Subject: fixing small bug in setting default port git-svn-id: https://reductivelabs.com/svn/puppet/trunk@625 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/client.rb | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/puppet/client.rb b/lib/puppet/client.rb index 3b47d10e8..acfa23af4 100644 --- a/lib/puppet/client.rb +++ b/lib/puppet/client.rb @@ -176,7 +176,7 @@ module Puppet end args = {:Server => hash[:Server]} - args[:Port] == hash[:Port] || Puppet[:masterport] + args[:Port] = hash[:Port] || Puppet[:masterport] if self.readcert args[:Certificate] = @cert @@ -378,11 +378,16 @@ module Puppet if restore #puts "Restoring %s" % file - newcontents = Base64.decode64(@driver.getfile(sum)) - newsum = Digest::MD5.hexdigest(newcontents) - File.open(file,File::WRONLY|File::TRUNC) { |of| - of.print(newcontents) - } + if tmp = @driver.getfile(sum) + newcontents = Base64.decode64(tmp) + newsum = Digest::MD5.hexdigest(newcontents) + File.open(file,File::WRONLY|File::TRUNC) { |of| + of.print(newcontents) + } + else + Puppet.err "Could not find file with checksum %s" % sum + return nil + end #puts "Done" return newsum else -- cgit