Fixed makehosts problem in xCAT-UI.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13692 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2012-09-01 12:32:02 +00:00
parent 2a6d3fa386
commit fa3822b7b3
2 changed files with 11 additions and 4 deletions

View File

@ -67,6 +67,11 @@ if (isset($_GET["cmd"])) {
$opts_array = array($opts);
}
}
// Time needed to update /etc/hosts
if (strncasecmp($cmd, "makehosts", 9) == 0) {
sleep(5);
}
// Submit request and get response
$xml = docmd($cmd, $tgt, $args_array, $opts_array);
@ -78,21 +83,21 @@ if (isset($_GET["cmd"])) {
$rsp = array();
// webrun pping and gangliastatus output needs special handling
if(strncasecmp($cmd, "webrun", 6) == 0 && (stristr($args, "pping") || stristr($args, "gangliastatus") || stristr($args, "chtab"))) {
if (strncasecmp($cmd, "webrun", 6) == 0 && (stristr($args, "pping") || stristr($args, "gangliastatus") || stristr($args, "chtab"))) {
$rsp = extractWebrun($xml);
}
// nodels output needs special handling
else if(strncasecmp($cmd, "nodels", 6) == 0) {
else if (strncasecmp($cmd, "nodels", 6) == 0) {
// Handle the output the same way as webrun
$rsp = extractNodels($xml);
}
// extnoderange output needs special handling
// This command gets the nodes and groups
else if(strncasecmp($cmd, "extnoderange", 12) == 0) {
else if (strncasecmp($cmd, "extnoderange", 12) == 0) {
$rsp = extractExtnoderange($xml);
}
// Write contents to file
else if(strncasecmp($cmd, "write", 4) == 0) {
else if (strncasecmp($cmd, "write", 4) == 0) {
// Directory should be /var/opt/xcat/profiles
// You can write anything to that directory
$file = "$tgt";

View File

@ -19,6 +19,7 @@ use Getopt::Long;
use Data::Dumper;
use xCAT::Table;
use xCAT::NodeRange;
use xCAT::zvmUtils;
use XML::Simple;
require XML::Parser;
@ -674,6 +675,7 @@ sub clonezlinux {
$out = `chtab node=$node noderes.netboot=zvm nodetype.nodetype=osi nodetype.provmethod=install nodetype.os=$os nodetype.arch=$arch nodetype.profile=$profile nodetype.comments="owner:$owner"`;
# Update hosts table and DNS
sleep(5); # Time needed to update /etc/hosts
`makehosts`;
`makedns`;