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... ";