From c3963a7f803052cdcd0b10a680a18d271e1f7029 Mon Sep 17 00:00:00 2001 From: Sheng Feng Xing Date: Tue, 17 Sep 2013 10:32:49 +0800 Subject: [PATCH] Fix #3784: CFMUtils.pm reports error messages in Verbose model if osimage.cfmdir is not set --- perl-xCAT/xCAT/CFMUtils.pm | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/perl-xCAT/xCAT/CFMUtils.pm b/perl-xCAT/xCAT/CFMUtils.pm index 3bbdeba38..0bbd01f28 100644 --- a/perl-xCAT/xCAT/CFMUtils.pm +++ b/perl-xCAT/xCAT/CFMUtils.pm @@ -235,24 +235,13 @@ sub setCFMSynclistFile { # get the cfmdir and synclists attributes my $osimage_t = xCAT::Table->new('osimage'); my $records = $osimage_t->getAttribs({imagename=>$img}, 'cfmdir', 'synclists'); - if ($records) + if (defined ($records->{'cfmdir'})) { - if ($records->{'cfmdir'}) {$cfmdir = $records->{'cfmdir'}} - if ($records->{'synclists'}) {$synclists = $records->{'synclists'}} + $cfmdir = $records->{'cfmdir'}; + if (defined ($records->{'synclists'})) {$synclists = $records->{'synclists'}} } else { - if ($::VERBOSE) - { - my $rsp = {}; - $rsp->{data}->[0] = "There are no records for cfmdir and synclists attribute in the osimage:$img. There is nothing to process."; - xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); - } - return; - } - - # no cfmdir defined, return directly - if (!$cfmdir) - { - return; + # no cfmdir defined, return directly + return 0; } my $found = 0;