From fa3822b7b3eac4bc81532de21535a4618b8c9a33 Mon Sep 17 00:00:00 2001 From: phamt Date: Sat, 1 Sep 2012 12:32:02 +0000 Subject: [PATCH] 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 --- xCAT-UI/lib/cmd.php | 13 +++++++++---- xCAT-UI/xcat/plugins/webportal.pm | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/xCAT-UI/lib/cmd.php b/xCAT-UI/lib/cmd.php index d272b9d79..37a9bec6a 100644 --- a/xCAT-UI/lib/cmd.php +++ b/xCAT-UI/lib/cmd.php @@ -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"; diff --git a/xCAT-UI/xcat/plugins/webportal.pm b/xCAT-UI/xcat/plugins/webportal.pm index 6bac4b854..1e56775ff 100644 --- a/xCAT-UI/xcat/plugins/webportal.pm +++ b/xCAT-UI/xcat/plugins/webportal.pm @@ -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`;