Synched z/VM code in 2.7 branch with trunk

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@13268 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2012-07-10 14:18:38 +00:00
parent 0a83ee6596
commit 09938be4d8
2 changed files with 36 additions and 13 deletions

View File

@ -194,11 +194,19 @@ zvmPlugin.prototype.loadServiceInventory = function(data) {
var tabId = args[0].replace('out=', '');
// Get node
var node = args[1].replace('node=', '');
// Get node inventory
var inv = data.rsp[0].split(node + ':');
// Remove loader
$('#' + tabId).find('img').remove();
// Do not continue if error is found
if (data.rsp[0].indexOf('Error') > -1) {
var warn = createWarnBar(data.rsp[0]);
$('#' + tabId).append(warn);
return;
}
// Get node inventory
var inv = data.rsp[0].split(node + ':');
// Create array of property keys
var keys = new Array('userId', 'host', 'os', 'arch', 'hcp', 'priv', 'memory', 'proc', 'disk', 'nic');
@ -738,13 +746,13 @@ zvmPlugin.prototype.loadClonePage = function(node) {
}
// If an IP address range is given and the starting and ending index do not match
if (ipRange && !(nodeStart == ipStart) || !(nodeEnd == ipEnd)) {
if (ipRange && (!(nodeStart == ipStart) || !(nodeEnd == ipEnd))) {
errMsg = errMsg + 'The node range and IP address range does not match. ';
ready = false;
}
// If a hostname range is given and the starting and ending index do not match
if (hostnameRange && !(nodeStart == hostnameStart) || !(nodeEnd == hostnameEnd)) {
if (hostnameRange && (!(nodeStart == hostnameStart) || !(nodeEnd == hostnameEnd))) {
errMsg = errMsg + 'The node range and hostname range does not match. ';
ready = false;
}
@ -900,11 +908,19 @@ zvmPlugin.prototype.loadInventory = function(data) {
var tabId = args[0].replace('out=', '');
// Get node
var node = args[1].replace('node=', '');
// Get node inventory
var inv = data.rsp[0].split(node + ':');
// Remove loader
$('#' + tabId).find('img').remove();
// Do not continue if error is found
if (data.rsp[0].indexOf('Error') > -1) {
var warn = createWarnBar(data.rsp[0]);
$('#' + tabId).append(warn);
return;
}
// Get node inventory
var inv = data.rsp[0].split(node + ':');
// Create status bar
var statBarId = node + 'StatusBar';
@ -979,7 +995,7 @@ zvmPlugin.prototype.loadInventory = function(data) {
});
// Align toggle link to the right
var toggleLnkDiv = $('<div class="toggle"></div>').css( {
var toggleLnkDiv = $('<div class="toggle"></div>').css({
'text-align' : 'right'
});
toggleLnkDiv.append(toggleLink);

View File

@ -1579,6 +1579,16 @@ sub inventoryVM {
# Get inputs
my ( $callback, $node, $args ) = @_;
# Output string
my $str = "";
# Check if node is pingable
if (`nodestat $node | egrep -i "noping"`) {
$str = "$node: (Error) Host is unreachable";
xCAT::zvmUtils->printLn( $callback, "$str" );
return;
}
# Get node properties from 'zvm' table
my @propNames = ( 'hcp', 'userid' );
@ -1598,10 +1608,7 @@ sub inventoryVM {
return;
}
# Capitalize user ID
$userId =~ tr/a-z/A-Z/;
# Output string
my $str = "";
$userId =~ tr/a-z/A-Z/;
# Load VMCP module
xCAT::zvmCPUtils->loadVmcp($node);