diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-09-06 04:20:53 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-09-06 04:20:53 +0000 |
commit | 21244f4f69c89f92b0ec451e5122774de3c548e3 (patch) | |
tree | 7f23961c5158d7194e0fda1cd86df0e91c479f3a /lib | |
parent | c0c958baa758665b2bbcb99c098e22e999b277dc (diff) | |
download | puppet-21244f4f69c89f92b0ec451e5122774de3c548e3.tar.gz puppet-21244f4f69c89f92b0ec451e5122774de3c548e3.tar.xz puppet-21244f4f69c89f92b0ec451e5122774de3c548e3.zip |
fixing small bug in setting default port
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@625 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/client.rb | 17 |
1 files changed, 11 insertions, 6 deletions
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 |