From 940450f8c16bee064c4695784fd2d3459f46b78c Mon Sep 17 00:00:00 2001 From: mellor Date: Wed, 5 Jan 2011 22:04:01 +0000 Subject: [PATCH] rollupdate defect 3145847 -- for verbose logging, create /var/log/xcat directory if it does not exist git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8559 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/rollupdate.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/rollupdate.pm b/xCAT-server/lib/xcat/plugins/rollupdate.pm index 17ee3b0f0..8733c4df8 100644 --- a/xCAT-server/lib/xcat/plugins/rollupdate.pm +++ b/xCAT-server/lib/xcat/plugins/rollupdate.pm @@ -443,6 +443,17 @@ sub rollupdate { } return ( $rc - 1 ); } + if ($::VERBOSE) { + unless ( -d $::LOGDIR) { + unless ( File::Path::mkpath($::LOGDIR) ) { + my $rsp; + push @{ $rsp->{data} }, "Could not create directory $::LOGDIR, logging is disabled."; + xCAT::MsgUtils->message( "W", $rsp, $::CALLBACK ); + $::VERBOSE = 0; + $::verbose = 0; + } + } + } if ($::VERBOSE) { my $rsp; push @{ $rsp->{data} }, "Running rollupdate command... ";