From 55f405a2b4e77d97ad71c649dcba0f4cf7ee3504 Mon Sep 17 00:00:00 2001 From: David Dollar Date: Fri, 15 Oct 2010 16:17:55 -0700 Subject: [PATCH] catch some common error cases --- lib/foreman/export/inittab.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/foreman/export/inittab.rb b/lib/foreman/export/inittab.rb index 446d009..ec18380 100644 --- a/lib/foreman/export/inittab.rb +++ b/lib/foreman/export/inittab.rb @@ -27,8 +27,8 @@ class Foreman::Export::Inittab < Foreman::Export::Base inittab = inittab.join("\n") + "\n" if fname - FileUtils.mkdir_p(log_root) - FileUtils.chown(user, nil, log_root) + FileUtils.mkdir_p(log_root) rescue error "could not create #{log_root}" + FileUtils.chown(user, nil, log_root) rescue error "could not chown #{log_root} to #{user}" write_file(fname, inittab) else puts inittab