From cc67df3caafdb1190421fe0b1d8f2fc6ee182e42 Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 7 Oct 2014 18:03:47 -0400 Subject: [PATCH] minor error msg fixes for kit cmds --- xCAT-server/lib/xcat/plugins/kit.pm | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 5f01a8db4..a96754747 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -1979,20 +1979,24 @@ sub addkitcomp # Read serverrole from osimage. $os{$osimage}{serverrole} = lc($osimagetable->{'serverrole'}); - } elsif ( !$osimagetable or !$osimagetable->{'osname'} ) { + } elsif ( !$osimagetable ) { my %rsp; - push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osname' attribute"; + push@{ $rsp{data} }, "osimage $osimage does not exist"; + xCAT::MsgUtils->message( "E", \%rsp, $callback ); + return 1; + } elsif ( !$osimagetable->{'osname'} ) { + my %rsp; + push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osname' attribute"; xCAT::MsgUtils->message( "E", \%rsp, $callback ); return 1; - } elsif ( !$osimagetable->{'osvers'} ) { my %rsp; - push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osvers' attribute"; + push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osvers' attribute"; xCAT::MsgUtils->message( "E", \%rsp, $callback ); return 1; } elsif ( !$osimagetable->{'osarch'} ) { my %rsp; - push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osarch' attribute"; + push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osarch' attribute"; xCAT::MsgUtils->message( "E", \%rsp, $callback ); return 1; } else { @@ -3336,20 +3340,24 @@ sub chkkitcomp # Read serverrole from osimage. $os{$osimage}{serverrole} = lc($osimagetable->{'serverrole'}); - } elsif ( !$osimagetable or !$osimagetable->{'osname'} ) { + } elsif ( !$osimagetable ) { my %rsp; - push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osname' attribute"; + push@{ $rsp{data} }, "osimage $osimage does not exist"; + xCAT::MsgUtils->message( "E", \%rsp, $callback ); + return 1; + } elsif ( !$osimagetable->{'osname'} ) { + my %rsp; + push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osname' attribute"; xCAT::MsgUtils->message( "E", \%rsp, $callback ); return 1; - } elsif ( !$osimagetable->{'osvers'} ) { my %rsp; - push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osvers' attribute"; + push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osvers' attribute"; xCAT::MsgUtils->message( "E", \%rsp, $callback ); return 1; } elsif ( !$osimagetable->{'osarch'} ) { my %rsp; - push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osarch' attribute"; + push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osarch' attribute"; xCAT::MsgUtils->message( "E", \%rsp, $callback ); return 1; } else {