fix feature request 189, support not contain existing postscript in kit

This commit is contained in:
chudegao 2015-03-11 18:02:31 +08:00
parent 793a6c1709
commit c51cfca5e1

View File

@ -1346,16 +1346,16 @@ sub addkit
} else {
$rc = system("cp -rf $kitdir/other_files/$_ $installdir/postscripts/");
}
if($rc && !-e "$installdir/postscripts/$_"){
my %rsp;
push@{ $rsp{data} }, "Failed to copy scripts from $kitdir/scripts/ to $installdir/postscripts";
xCAT::MsgUtils->message( "E", \%rsp, $callback );
return 1;
}
$rc = 0;
chmod(0755,"$installdir/postscripts/$_");
}
if($rc){
my %rsp;
push@{ $rsp{data} }, "Failed to copy scripts from $kitdir/scripts/ to $installdir/postscripts";
xCAT::MsgUtils->message( "E", \%rsp, $callback );
return 1;
}
# Copying plugins to /opt/xcat/lib/perl/xCAT_plugin/
if ( -d "$kitdir/plugins/" ) {