Changed location where directory entry is retrieved.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12204 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2012-04-11 22:40:44 +00:00
parent 57b7c99c0f
commit 90b9b596e0
2 changed files with 10 additions and 12 deletions

View File

@ -2720,26 +2720,25 @@ function createZProvisionNew(inst) {
var thisTabId = $(this).parents('.ui-tabs-panel').attr('id');
// Get objects for HCP, user ID, and OS
var hcp = $('#' + thisTabId + ' input[name=hcp]');
var userId = $('#' + thisTabId + ' input[name=userId]');
var os = $('#' + thisTabId + ' input[name=os]');
// Get default user entry when clicked
if ($(this).attr('checked')) {
if (!hcp.val() || !os.val() || !userId.val()) {
if (!os.val() || !userId.val()) {
// Show warning message
var warn = createWarnBar('Please specify the hardware control point, operating system, and user ID before checking this box');
var warn = createWarnBar('Please specify the operating system and user ID before checking this box');
warn.prependTo($(this).parents('.form'));
// Highlight empty fields
jQuery.each([hcp, os, userId], function() {
jQuery.each([os, userId], function() {
if (!$(this).val()) {
$(this).css('border', 'solid #FF0000 1px');
}
});
} else {
// Un-highlight empty fields
jQuery.each([hcp, os, userId], function() {
jQuery.each([os, userId], function() {
$(this).css('border', 'solid #BDBDBD 1px');
});
@ -2753,7 +2752,7 @@ function createZProvisionNew(inst) {
data : {
cmd : 'webrun',
tgt : '',
args : 'getdefaultuserentry;' + hcp.val() + ';' + profile,
args : 'getdefaultuserentry;' + profile,
msg : thisTabId
},
@ -2771,7 +2770,7 @@ function createZProvisionNew(inst) {
$('#' + thisTabId + ' textarea:visible').val('');
// Un-highlight empty fields
jQuery.each([hcp, os, userId], function() {
jQuery.each([os, userId], function() {
$(this).css('border', 'solid #BDBDBD 1px');
});
}

View File

@ -2214,18 +2214,17 @@ sub web_getdefaultuserentry {
my ( $request, $callback, $sub_req ) = @_;
# Get hardware control point
my $hcp = $request->{arg}->[1];
my $profile = $request->{arg}->[2];
my $profile = $request->{arg}->[1];
if (!$profile) {
$profile = 'default';
}
my $entry;
if (!(`ssh $hcp "test -e /opt/zhcp/conf/profiles/$profile.direct && echo 'File exists'"`)) {
$entry = `ssh $hcp "cat /opt/zhcp/conf/profiles/default.direct"`;
if (!(`test -e /var/opt/xcat/profiles/$profile.direct && echo 'File exists'`)) {
$entry = `cat /var/opt/xcat/profiles/default.direct`;
} else {
$entry = `ssh $hcp "cat /opt/zhcp/conf/profiles/$profile.direct"`;
$entry = `cat /var/opt/xcat/profiles/$profile.direct`;
}
$callback->( { data => $entry } );