summaryrefslogtreecommitdiffstats
path: root/lib/puppet.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-08-23 21:23:57 +0000
committerLuke Kanies <luke@madstop.com>2005-08-23 21:23:57 +0000
commit5b20c92ff322ba1886209f788ce6a7df05315cf5 (patch)
tree8b75ab42323ef07de4a5cab6182b4c8eff8eb5da /lib/puppet.rb
parentba51e700ace1b34b2dbb06bc61287be184fe46ec (diff)
downloadpuppet-5b20c92ff322ba1886209f788ce6a7df05315cf5.tar.gz
puppet-5b20c92ff322ba1886209f788ce6a7df05315cf5.tar.xz
puppet-5b20c92ff322ba1886209f788ce6a7df05315cf5.zip
Have done a significant reorganization of how clients work, also, along with some interesting trouble shooting on components
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@585 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet.rb')
-rw-r--r--lib/puppet.rb31
1 files changed, 18 insertions, 13 deletions
diff --git a/lib/puppet.rb b/lib/puppet.rb
index 64a3821a9..ba432f492 100644
--- a/lib/puppet.rb
+++ b/lib/puppet.rb
@@ -190,19 +190,24 @@ module Puppet
# XXX this should all be done using puppet objects, not using
# normal mkdir
def self.recmkdir(dir,mode = 0755)
- tmp = dir.sub(/^\//,'')
- path = [File::SEPARATOR]
- tmp.split(File::SEPARATOR).each { |dir|
- path.push dir
- if ! FileTest.exist?(File.join(path))
- Dir.mkdir(File.join(path), mode)
- elsif FileTest.directory?(File.join(path))
- next
- else FileTest.exist?(File.join(path))
- raise "Cannot create %s: basedir %s is a file" %
- [dir, File.join(path)]
- end
- }
+ if FileTest.exist?(dir)
+ return false
+ else
+ tmp = dir.sub(/^\//,'')
+ path = [File::SEPARATOR]
+ tmp.split(File::SEPARATOR).each { |dir|
+ path.push dir
+ if ! FileTest.exist?(File.join(path))
+ Dir.mkdir(File.join(path), mode)
+ elsif FileTest.directory?(File.join(path))
+ next
+ else FileTest.exist?(File.join(path))
+ raise "Cannot create %s: basedir %s is a file" %
+ [dir, File.join(path)]
+ end
+ }
+ return true
+ end
end
end